Validation queries - bordercolor and map

They have: 112 posts

Joined: Aug 2001

Hi Peeps,

I have two validation issues at my site that I can't find adequate solutions too. The first is bordercolor - I recoded it using CSS to define the border colour and it gave quite a different result and one I wasn't happy with. It's very possible that I didn't code well - CSS ain't my forte yet. So I put the bordercolor attribute back to see what other people come up with.

The second validation problem is the tag (used for hotspots) and I haven't been able to find any solutions to that. What do the CSS gurus recommend?

The site home page is laughingbuddhadesign.com

Blue

Busy's picture

He has: 6,151 posts

Joined: May 2001

add #bgcolour {bordercolor:#783820;}' between your style tags and in your table tag add id="bgcolour"'

your map tags are between the and , take the tag from below the map tags and place after the before the map tags

and then it will validate

They have: 112 posts

Joined: Aug 2001

Thanks Busy, you were spot on with both and now it will validate, although I haven't changed the bordercolor tag because it displays differently to the original. I may have to live with it and if that's the case I may even drop the border because the validated display looks a bit funky. You can see the difference at these two links.

Original - http://www.laughingbuddhadesign.com
Validated code - http://www.laughingbuddhadesign.com/copy_of_index.html

If anyone has any suggestions about why it displays differently please let me know. Otherwise the wee border may have to go .....

Cheers,

Blue

Busy's picture

He has: 6,151 posts

Joined: May 2001

What browser are you using, looks the same to me on FF
Mind you the colour isnt a RGB one so can look different on different screens, try choose a colour closer to the RGB ones.
Try something like #7B3921 (is a 256 colour)

remember the 0's are numbers not letters in colour codes

He has: 113 posts

Joined: Jul 2005

bordercolor isnota w3c valid property for anyelement. Its an IE only thing. they way around it is to use:

style="border-color: #ececec;"'

on the element you wish to change the border colour. A better method to inline css would be to define a special class for the elements with border colours tho.

They have: 112 posts

Joined: Aug 2001

Well here's what happened ...... I did all of the above and I realised the reason it looked different to me was that IE was not recognising the style tag for that table so it simply displayed the table border as white. No matter how I tried it wouldn't work so I created a new style for that tag in the css file and it works perfectly. Now it validates! Thanks.

Busy's picture

He has: 6,151 posts

Joined: May 2001

Just remember in CSS the id can only be used once per page, the class can be used over and over - a common oversight

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

Another correction to busy's code - bgcolour is not a semantic name for a class, it's purely aesthetic. With CSS you are attempting to separate form from function as much as possible. The CSS class names should match the function in the HTML, while the actual CSS describes the form. You should name your classes for what they are doing, not what they are making something look like. So in this case you could call it "splashcontainer" or "splashframe". This way you'll also be able to add more CSS to that element.

Busy's picture

He has: 6,151 posts

Joined: May 2001

The big problem with using semantic names is they are throw away names - not useable elsewhere.

Imagine you called this class "frontpagesplashframe" although over the top it is exactly what it could be, now say we want the same properties elsewhere, imagine finding id="frontpagesplashframe" on the contact page or orderform or similar?
While I admit my choice wasn't the best, a better one to use would be "bordercolor" or "brownborder", this way it can be reused which saves on coding/bandwidth/load time.
Depending on the code involved it can be different but in this case a semantic name is not ideal

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

Putting one class in it's own CSS property wouldn't be very good use of a code even if you wanted to re-use it all over. Then you'd probably end up with a lot of multiple classes on everything. In this case you could call it "frame" or "outline' or something. "brownborder" wouldn't make any sense if you wanted to change it to green, and "bordercolour" wouldn't make sense if there were other elements in there like, say, padding.

So you can (and should) have semantic class names that are re-usable elsewhere when necessary. Semantic names are always ideal Smiling I find that I learn to structure my code better I use classes less and less. If you had all your tables in a certain area you'd use #content table instead of putting a class on all of them.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.