My CSS code doesn't work..?
-
here is the code for my html and i want the "current class" inside <li> tag to work but it doesnt seem to work. HTML: <!doctype html> <html> <head> <meta charset="UTF-8"> <title></title> <script> <src="http://html5shiv.googlecode.com… </script> <link rel="stylesheet" type="text/css" href="main.css"> </head> <body> <div id="container"> <ul id="main-nav"> <li class="current"><a href="index.html"><span>Home</span></a><… <li><a href="about.html">About</a></li> <li><a href="#">Faqs</a></li> <li><a href="#">Contact</a></li> </ul> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> </div> </body> </html> CSS: /*the following rule is important!*/ article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary { display:block; } html{ background: #fff; } body{ font-family: "Palatino Linotype" ,Palatino, Serif; color: #000; width: 1000px; margin: 0 auto; background: #ccc; } p{ clear: both; display: block; } #main-nav{ /* clear: right;*/ margin: 0px; padding: 0px; } #main-nav li{ background: #000; width: 250px; position: relative; float: left; list-style: none; text-align: center; /* outline: 1px solid red;*/ } #main-nav a:link{ position: relative; display: block; text-decoration: none; color: #fff; } #main-nav a:visited{ color: #fff; } #main-nav a:hover{ color: #000; background: #ccc; } .current{ background: #ccc; } the .current doesnt work anyone know how it works? tnx in advance
-
Answer:
U have to check u'r code.
Yuki at Yahoo! Answers Visit the source
Other answers
The li.current class is malformed (Look at the closing li). You should test your website in all the popular browsers - not just Firefox
Related Q & A:
- How come CD doesn't work in my shell script?Best solution by Super User
- Youtube doesn't work on iphone?Best solution by answers.yahoo.com
- Google doesn't work (google.com) on any computer?Best solution by Yahoo! Answers
- Yahoo Music Doesn't Work?Best solution by Yahoo! Answers
- Mail search doesn't work?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.