Maybe you could explain to me what width actually does? I'm a bit in the dark on the working of this, since, apparantly, it does not really control the width of elements really hard (at least in my work).
width as name suggest its self explaining. Width works perfectly in all browsers and in my code too.
A second question is:
#leftMenu
{
width: 250px;
}
I wonder what kind of thing #leftMenu actually is. I found some info on this on the w3schools site, but I don't really understand what it is about.
#leftMenu is an
ID Name. Ok, what's an ID name? Here's explanation:
Lets look at solution to a problem where you have to apply some style on hyperlinks, yes
<a> tags.
First method is to make all of them look same
a
{
color: #FF0000;
background-color: #CCCCCC;
}
Second method is to make a class or id. The difference is that you could use same class name several times but a particular ID only once, as per standards. ID is unique name for every tag there. I hop you know what classes are as I could see
a.links in the code posted by you. Using ID's are very similer.
Here's HTML code
<a href="#" id="homeLink">Homepage</a>
Adding style to this will use
#homeLink. This would search for any tag with ID
homeLink. To be more specific we use
a#homeLink. This would make browser search for ID homeLink in all <a> tags.
Here's how CSS will look like:
a#homeLink
{
color: #FF0000;
background-color: #CCCCCC;
}
Now if you have several links, it would be non-standard to use ID homeLink with every link and ridiculous to write a class name with every link. So what we do
<div id="links">
<a href="#">Homepage</a>
<a href="#">Products</a>
<a href="#">Downloads</a>
<a href="#">About</a>
</div>
And make CSS look like
#links a
{
color: #FF0000;
background-color: #CCCCCC;
}
Note the difference between the CSS codes in both cases i.e.
a#homeLink and
#links a. The reason is we embed all the links under single div with ID
links in second case but in first case every tag will have its own ID/class.
I hope I am clear and explained well.