Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS not working in ASP .NET 2

Status
Not open for further replies.

qwert231

Programmer
Sep 4, 2001
756
US
I am trying to set my .css file to make certain links have a hover setting. Using IE6 to browse. It worked in ASP classic.

Here is my .css file snippet (Have to have link and visited first):
Code:
a.nav: link {
 color: black;
 font-weight: bold;
 font-size: 10pt;
 text-decoration: none;
}
a.nav: visited {
 color: black;
 font-weight: bold;
 font-size: 10pt;
 text-decoration: none;
}
a.nav: hover {
 color: black;
 background: #FFCC00;
 font-weight: bold;
 text-decoration: none;
}

And here is the header of my .Net page, including the CSS call:
Code:
<head>
    <title>Welcome to Century Color</title>
    <link href=&quot;/Default.vsdisco&quot; type=&quot;text/xml&quot; rel=&quot;alternate&quot; />
    <meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=windows-1252&quot; />
    <meta http-equiv=&quot;Content-Language&quot; content=&quot;en-us&quot; />
    <meta content=&quot;Microsoft FrontPage 4.0&quot; name=&quot;GENERATOR&quot; />
    <meta content=&quot;FrontPage.Editor.Document&quot; name=&quot;ProgId&quot; />
    <link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;mainStyle.css&quot; />
</head>
 
I tried out your style sheet and it is not changing the links at all. However, any other style sheet item that isn't affecting hyperlinks does work. I would venture a guess that this is a browser thing though I don't know. That'l do donkey, that'l do
[bravo] Mark
 
I got it working, but only by changing the classes in the css.

Maybe the old edition of the CSS standards used a.nav:, but now you don't need the .nav part. Try this in your CSS and see if it works for you (it did for me)


A:link {
color: black;
font-weight: bold;
font-size: 10pt;
text-decoration: none;
}
A:visited {
color: black;
font-weight: bold;
font-size: 10pt;
text-decoration: none;
}

A:hover
{
color: black;
background: #FFCC00;
font-weight: bold;
text-decoration: none;
}


And if it does work, try this css one:
Jack:star
{
color: purple;
}
;)

Kidding, kidding (or am I?)

Jack
 
Kewl, yea, I guess I can do that, but the thing was, I was trying to do a.Nav with Nav being a class. Hmmm... I wonder if I drop the A. Thanks Jack.
 
Well, if I change it to just
Code:
A:link...
it works, or if I change it to
Code:
.nav
and give my links this:
Code:
<a class='nav' href...></a>
it also works. But only those links that I've specified to have the .nav class. So, I guess that means that now, I can't specify the same name for a class for multiple elements. That's fine. It works, I'm happy.
 
I guess somebody didn't catch the hint Jack heheh ;P I guess I can take care of it. =) Daren J. Lahey
Just another computer guy...
 
sniff sniff... so proud heheheh
Congrats buddy! Daren J. Lahey
Just another computer guy...
 
Well that doesn't make sense: This post says I'm tops, the main forum says its still Paul. Curses! I'll catch him yet!
;)

Jack
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top