2 replies [Last post]
Raven21633
Raven21633's picture
Offline
newbie
Last seen: 13 years 4 weeks ago
Joined: 2007-12-15
Posts: 6
Points: 0

I don't even know where to begin in asking this question. :shrug:

I'm trying to plug my content into one of those free web templates, so I didn't write the code.

Somewhere in all this mess (and it's not in the #content a { where you might expect it) the code is changing the hyperlinks to look like grey buttons. That's great in most parts of the page, but how do I over-ride this style to revert back to the good old blue underlined text?

Here's the CSS:

#content {
margin:0 0 0 220px; /* (top, right, bottom, left) */
border-left:1px solid #eee;
}
#content h1 {
font-family:Garamond, Georgia, "Times New Roman", Times, serif;
font-size:34px;
font-weight:normal;
color:#000;
letter-spacing:-1px;
background-image:url(../images/backgrounds/h1.jpg);
background-position:left;
background-repeat:no-repeat;
padding:50px 10px 10px 30px;
border-top:2px solid #eee;
}
#content h2 {
font-family:Garamond, Georgia, "Times New Roman", Times, serif;
font-size:24px;
font-weight:normal;
color:#000;
letter-spacing:-1px;
padding:15px 15px 15px 40px;
}
#content h3 {
font-family:"Trebuchet MS", Tahoma, Verdana;
font-size:14px;
font-weight:normal;
color:#008CBA;
letter-spacing:-1px;
padding:0px 15px 0px 40px;
margin:0;
}

#content p {
padding:20px 50px 20px 50px;
line-height:20px;
}
#content ul {
margin: 10px 10px 10px 30px;
}
#content li {
list-style:none;
background-image:url(../images/backgrounds/li.jpg);
background-position:top left;
background-repeat:no-repeat;
padding:0px 5px 0px 20px;
margin:15px 0 15px 0;
}

#content input {
width:300px;
background-color:#f6f6f6;
border-top:1px solid #eee;
border-right:1px solid #f9f9f9;
border-bottom:1px solid #f9f9f9;
border-left:1px solid #eee;
font-family:"Trebuchet MS", Tahoma, Verdana;
color:#ccc;
padding:4px;
margin:3px 3px 3px 50px;
}
#content input:hover {
border:1px solid #ccc;
color:#666;
}
#content input:focus {
border:1px solid #999;
color:#333;
}

#content textarea {
width:300px;
background-color:#f6f6f6;
border-top:1px solid #eee;
border-right:1px solid #f9f9f9;
border-bottom:1px solid #f9f9f9;
border-left:1px solid #eee;
font-family:"Trebuchet MS", Tahoma, Verdana;
color:#ccc;
padding:4px;
margin:3px 3px 3px 50px;
}
#content textarea:hover {
border:1px solid #ccc;
color:#666;
}
#content textarea:focus {
border:1px solid #999;
color:#333;
}

#content a {
color:#333;
background-color:#eee;
border-bottom:1px solid #ccc;
padding:0 4px 0 4px;
text-decoration:none;
}
#content a:hover {
background-color:#ddd;
border-bottom:1px solid #bbb;
color:#000;
}

#content img {
float:right;
border:none;
margin:10px 10px 10px 20px;
padding:5px;
background-color:#fff;
border:3px solid #eee;
}

And this is how it renders:

What I want to do is keep the "Printer Friendly" button looking exactly as it does, but for the other two hyperlinks I want to go back to the good old underlined blue hyperlink of years past. The "button" styling just doesn't fit with the standard text.

I have tried just writing another ID and use <a id="new_something" href="..... but that doesn't work at all.

How do I temporarily break a style to use another style, or give it a higher priority?

Thank You Smile
Raven

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 6 years 1 week ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Adding an ID to the rules

Adding an ID to the rules styling those grey links should work.

#content a#new_something {}
#content a#new_something:hover {}

If it doesn't then something else is occurring.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Raven21633
Raven21633's picture
Offline
newbie
Last seen: 13 years 4 weeks ago
Joined: 2007-12-15
Posts: 6
Points: 0

Thanks Hugo.

Thanks Hugo.

After excessive digging on Specificity, I decided to change all those #content to .content and then use #old_links {} (without the a) and then apply it that way. It worked like a charm, but after trying everything else in the book, it turned out to be the only thing that worked. :curse:

Actually this template has some serious issues. The author used ID's in a lot of places where he should have used Classes and then simply recycled. One example of this bloating of code is that section of the CSS I posted in my OP is actually iterated 2 more times with a different ID name for each, all this just to make 3 boxes on the screen.

I will openly admit my ignorance of CSS, but I would think that, since the three sections of code were identical, a single Class statement would have sufficed quite well. (in fact, it did! I have just about re-written this whole template. If it weren't for the fact I like the layout I'd drop his copyright statement in a heartbeat).

Thanks again
Raven