PDA

View Full Version : [RESOLVED] Hyperlinks / CSS formatting


LeeWCarl
05-10-2007, 10:12 AM
I'm new to CSS but have inherited a piece of work which uses the departments standard CSS formatting sheet.

Within the sheet is an entry:
THEAD
{
BORDER-RIGHT: #081c80 1px solid;
BORDER-TOP: #081c80 1px solid;
FONT-WEIGHT: bold;
FONT-SIZE: 8pt;
BORDER-LEFT: #081c80 1px solid;
COLOR: white;
BORDER-BOTTOM: #081c80 1px solid;
FONT-FAMILY: Verdana;
BACKGROUND-COLOR: #081c80;
PADDING-TOP: 2px;
PADDING-BOTTOM: 2px;
PADDING-LEFT: 2px;
PADDING-RIGHT: 2px}

problem now is if I place hyperlinks inside table cells tagged with <THEAD>, the default appearce is the same colour as the background, so you can't see them!.

How easy is it to amend the CSS file to specify the colour which hyperlinks will appear (but only those appearing within THEAD tags...I need to leave all other hyperlinks the default colour)

Appreciate any help guys

Lee

acslater323
05-10-2007, 11:42 AM
First of all, you'd be wise to lose all the capital letters in your selectors and attributes. I'm not sure that's valid CSS.

To make a rule for links in a thead tag, you need to do this:

thead a {
color:#fff;
}

You may have pseudo classes declared for links earlier in your stylesheet, so it's wise to follow up with this:


thead a:link, thead a:visited {
/*insert your unvisited and visited properties here */
}
thead a:hover, thead a:active {
/* insert your hover and active state here */
}

johnz
05-10-2007, 02:11 PM
Lee, welcome to the forums!!! :cool:

As acslater suggested, you may want to look into using lowercase for all your CSS and HTML.

For the CSS you posted, it can be taken down to just 5 lines. Like this:

thead {
padding: 2px;
border: 1px solid #081C80;
font: bold 8pt verdana;
background-color: #081C80;
color: #FFF;
}

Excavator
05-10-2007, 08:41 PM
I just wrote a little test page with all the CSS in CAPS and I could not find one validator that did not say it was ok. I wonder if we just write the CSS in lowercase out of habit then, because I can't find any spec that requires it. Not like XHTML requiring the markup be in lowercase.

CSS Code is not written the same way as HTML code. This makes sense because CSS is not HTML, but rather a way of manipulating existing HTML.

Horus_Kol
05-10-2007, 09:18 PM
yeah, but for readability - lowercase is always better...

Excavator
05-10-2007, 09:27 PM
yeah, but for readability - lowercase is always better...

I'm not disagreeing with you or johnz, I just can't find where it's required to be lowercase. CSS that works and validates in lower case works and validates in uppercase.
(I did not bother to test inline CSS as I don't really consider that a usable form of CSS)

BonRouge
05-10-2007, 10:58 PM
CSS is (mostly) case-insensitive: http://www.w3.org/TR/CSS21/syndata.html#q6

LeeWCarl
05-11-2007, 03:31 AM
Thanks for all the responses! I'll dive back into the stylesheets after coffee and let you know the results.

Think maybe it's time I got myself a decent book on CSS...looks interesting

Lee

LeeWCarl
05-11-2007, 04:42 AM
FANTASTIC!!!!!!!!!!!!!!!!!!!!!!!!!! Works perfectly

Thanks for your time and attention everyone. I owe you one.

Lee