creating drop down menu bar

Asked By waseem kaleem
19-Jul-10 02:04 AM
Earn up to 0 extra points for answering this tough question.
Can anybody tells me how can i create dropdown menu bar in html?

  re: creating drop down menu bar

Sasha Kotlo replied to waseem kaleem
19-Jul-10 02:26 AM
Yes it's easy. You would use html combined with CSS to do it. Here's a good tutorial on the subject:


Regards.

  re: creating drop down menu bar

waseem kaleem replied to Sasha Kotlo
19-Jul-10 01:37 PM
I know CSS very little.I doesnot know what will these tags "#menu h2" and "#menu ul ul ul" perform? #menu define new data type? 

  re: creating drop down menu bar

Sasha Kotlo replied to waseem kaleem
19-Jul-10 04:58 PM
CSS is quite an intuitive language..lets take the things you mentioned and let me explain you what they mean:

#menu h2

when you create an html element on the page you can give it an id like the following:

<div id="menu">

</div>

elements in CSS can be accessed either by using their IDs, class names (ill explain that in a bit as well) and also by element types (p, div, a, ul, etc). So basically what #menu h2 means is the following:

get the element which ID is menu (notice that by saying #menu alone you will get any element with ID of menu). You can also specify that you want to select only div elements with ID menu which is done as following:

div#menu

so this code will select a div on page which has an ID attribute set to menu.

Now further on by separating elements in CSS this is what happens:

#menu h2

what this code does is following. Get the element on the page whose ID is menu and select an h2 element inside of it and apply the following layout rules (this is inside the parenthesis).. So something like this:

#menu h2
{
color: #000; /* Sets the font color of the h2 element to black */
font-size: 24px; /* self-explanatory */
font-style: italic; /* set the style of the font to be italic letters */
}

Anyways to learn more you can visit the official website of WC3 and read the basics of CSS.. If you're to start learning web developing CSS is a must known tool and everyone, absolutely everyone you ever work for will demand you to have good knowledge of it.


Best of luck,
Regards.
  re: creating drop down menu bar
waseem kaleem replied to Sasha Kotlo
21-Jul-10 12:06 PM
i am sorry.Can you differentiate these two difinitions with examples ul#menu and #menu ul?
  re: creating drop down menu bar
Sasha Kotlo replied to waseem kaleem
21-Jul-10 12:12 PM
Yes of course. First:

ul#menu is referencing an ul element whose id is set to menu like this:

<ul id="menu">

</ul>

as for #menu ul it means get the ul element inside any element which is named menu like for example:

<div id="menu">
<ul>

</ul>
</div>

or

<p id="menu">
<ul>

</ul>
</p>

Hope that helps you.

Regards.
  re: creating drop down menu bar
waseem kaleem replied to Sasha Kotlo
22-Jul-10 12:51 PM

Thank you very much for replies.
#stl tr.w td
it means gets element td whose id is stl and class is w.if anyone of them is miss then style is not implement.I define this correct or not. I has learnt all this for creating drop down menu.i can create different boxex.but idoesnot create successfully.Sir can you provide me an article about creating drop down menu using CSS and java?

Thanks

  re: creating drop down menu bar
Sasha Kotlo replied to waseem kaleem
22-Jul-10 12:56 PM
You don't need to use Javascript at all. In fact CSS is more reliable for a menu than javascript. as for #stl tr.w td you understood wrong. Read it left from right, not right to left.

#stl - get an element whose id is stl
tr.w - find a tr element (with class set to w) inside the #stl element
td - find a td element inside tr with class w which is also inside the #stl element

Hope that helps you.

Regarding the tutorial here is one done using CSS:


Regards.
  re: creating drop down menu bar
Sasha Kotlo replied to Sasha Kotlo
22-Jul-10 12:56 PM
pardon me, typo error:

Read it left TO right, not right to left.
Create New Account