What makes a horizontal UL CSS Menu horizontal?
This one line:
li {
display:inline;
}
That’s it. The rest is just decoration and making it look right.
What makes a horizontal UL CSS Menu horizontal?
This one line:
li {
display:inline;
}
That’s it. The rest is just decoration and making it look right.
Weird error today I thought worth posting the solution to.
If your style sheet has this line at the top Safari won’t display certain background colors.
@charset “utf-8”;
When you create an HTML file in Dreamweaver and add CSS directly to the HTML file, it will automatically insert this into the style section. If you then copy the entire style section and create an external stylesheet, it will then remove all of your background colors. Luckily, it’s an easy fix. Just remove the charset. It’s not needed for CSS unless you’re using a foriegn language that has non-ascii characters (in the code, not the text).
I found a weird thing today. IE6 will remove the top margin of a hover link when it’s in a list if it has hover attributes. It’s too hard to explain without the code, so here is the code to re-create the phenomenon. This will make a list that when you hover over the links they jump up as the top margin is removed.
<p><style><br />
ul li a {<br />
display: block;<br />
width: 155px;<br />
margin-bottom: 3px; <br />
}<br />
ul li a:hover {<br />
color: #FFFFFF;<br />
background-color: #FC7C00;<br />
} </p>
<p></style><br />
<body><br />
<ul><br />
<li><a href="#">test</a></li><br />
<li><a href="#">test</a> </li><br />
</ul><br />
</body></p>
The only fix I could find is simply to add a space before the closing a tag like so:
<ul><br />
<li><a href="#">test </a></li><br />
<li><a href="#">test </a> </li><br />
</ul>
If you know of a better way to fix it, or if you know why it does this, please let me know!