Ask your own question, for FREE!
Computer Science 15 Online
OpenStudy (anonymous):

Created a horizontal menu using css and html but now all other

    elements on my page will float to left because of this. How can I fix it? nav ul, li { margin: 0; padding: 0; list-style: none; float: left; }

OpenStudy (anonymous):

Because you haven't specified the dependency that li has on ul and nav. So basically your CSS has it where you are saying. "For all unordered lists who's parent is a nav tag and for all list items" That is probably why all your ul elements are acting funny

OpenStudy (anonymous):

Try it out

OpenStudy (anonymous):

nav li{ position: relative; } nav ul { height: 2em; width: 100%; } nav li a{ display: block; line-height: 3em; padding: 0 1em; color: #e7e5e5; font-weight: bold; text-shadow: 0 1px 1px rgba(0,0,0, .3); }

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!