Jump to content

Class Issues


BenC

Recommended Posts

Like the title says, this works in FF but not IE...and I'm not sure why, because it's just a basic class. Here is the appropriate code:In the CSS file....

#menu li a.current {	background: url(menu8.gif) 0 -64px;	padding: 8px 0 0 25px;}

In the page ...

<li><a href="faculty.htm" title="Faculty" class="current">Faculty</a></li>

I will note that both of these DO work in FF and IE...

#menu li a:link, #menu li a:visited {	color: #0000cc;	display:block;	background: url(menu8.gif);	padding: 8px 0 0 20px;	}	#menu li a:hover {	color: #777;	background: url(menu8.gif) 0 -32px;	padding: 8px 0 0 25px;	}

Am I missing something?

Link to comment
Share on other sites

if you're making a list of links using <ul> and <li> etc...then you only need to give the ul a class. Giving each <a> tag a class in the list is putting in too much code when you can do the same job with less.Have a look at this:css:

ul{list-style:none;font-family:Arial, Verdana, Times New Roman;font-size:12px;padding-left:0px;}li a{color:#000000;}li a:hover{color:#0000FF;}

html:

<ul><li><a href="page1.htm">page 1</a></li><li><a href="page2.htm">page 2</a></li><li><a href="page3.htm">page 3</a></li><li><a href="page4.htm">page 4</a></li><li><a href="page5.htm">page 5</a></li><li><a href="page6.htm">page 6</a></li></ul>

Link to comment
Share on other sites

Ahhhhh i see,Ok this isnt exactly correct but you can get the idea from this. For ie use a:active

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Untitled Document</title><style type="text/css"><!--ul li {	background-color:#336699;	width:150px;	margin-bottom:30px;	padding:5px;}ul li a{	background-color:#336699;}ul li a:hover{	background-color:#FF6699;}ul li a:active{	background-color:#FFFF66;}--></style></head><body><ul><li><a href="#" title="Faculty" class="current">Faculty</a></li><li><a href="#" title="Faculty" class="current">Faculty</a></li><li><a href="#" title="Faculty" class="current">Faculty</a></li></ul></body></html>

oh p.sDont be sucked in to this whole 'ie sucks, and FF is great' debate. If you ask me i would take ie over FF, ie may not support css properly but it was around longer than css became popular. Its a bit like saying ie v4 doesnt display it right...well duh. I find FF slow and has just as many bugs as ie. But, and this is important, over 50% still use ie, so if you design for the minority and disregard the majority, you may not achive what you hope to.Dont think im being preachy, just trying to help :)

Link to comment
Share on other sites

Thanks for the tip, I'll take a look at that code and make some changes.As far as the FF vs IE debate.... for this specific page, 99.9% of the people viewing it will have IE (state government), so that's why I really wanted it to work for them.

Link to comment
Share on other sites

Ok so this may be wrong, but I just changed it to:

#menu li a.current, #menu li a:active {	background: url(menu8.gif) 0 -64px;	padding: 8px 0 0 25px;}

In the design view of Dreamweaver, it shows correctly, but it still doesn't show in IE. Is that the wrong way to use that?

Link to comment
Share on other sites

  • 1 month later...

Ok, so I took an extended break from this project, but now I'm back on it.....the a:active thing works for when the link is in down state, but that's not really what my goal is. My goal is for the menu to have the darker image on it when you're on that page, that's why was trying using a class. I had #menu li a.current because it worked in FF. Any more suggestions?EDIT:forgot to say that the link changed to http://www.courts.mo.gov/hosted/juded/offi...ety/faculty.htm

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...