Forum Moderators: open

Message Too Old, No Replies

CSS and links

showing my total ignorance...

         

Stefan

7:59 pm on Jan 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



My apologies for asking about this. In the last few days I added this

<style type="text/css">
<!--
A:link { color: dddddd; text-decoration: underline; }
A:active { color: #0099ff; text-decoration: underline; }
A:visited { color: #dddddd; text-decoration: underline; }
A:hover { color: #ffffff; text-decoration: none; }
-->
</style>

in the <head></head>. My concern is that the page has a black bgcolor, and I have no idea if Google reads the <style></style> content and might assume the link is black and therefore hidden, (even though the links are on a silver background table cell).
The site is PR6 and doing great on Google... I don't want to mess things up just before the deepcrawl.

Thanks for any help.

Knowles

8:01 pm on Jan 29, 2003 (gmt 0)

10+ Year Member



Simple fix add this to the style
body { background : #000000; }

and remove it from your body tag (I am assuming thats where its located right now.)

I dont know if google reads them but if they dont then they wont see the black background so it would assume the defaults

Stefan

8:08 pm on Jan 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Many thanks! That was fast. Yes the bgcolor is in the body tag. I'll get on it right now before the deepcrawl bot comes through... I already had the freshbot this AM since I changed things.

Nick_W

8:12 pm on Jan 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Put the styles external and exclude robots in robots.txt if it worries you (though it really isn't an issue...)

<link rel="stylesheet" type="text/css" href="/css/styles.css" />

Nick

DrDoc

8:14 pm on Jan 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Two little things ..

First, change

A:link { color: dddddd; text-decoration: underline; } 

to
A { color: [b]#[/b]dddddd; text-decoration: underline; } 

Then, if you're worried about Google not "knowing" the links are on a silver background, why not add the background color to all the links as well?

A { color: #dddddd; text-decoration: underline; [b]background: silver;[/b] }

.. etc

This will eliminate any concerns you might have. Also, it is considered good style to always specify a background color whenever you specify a text color, and vice versa, just to ensure that they won't clash on any browser.

Stefan

8:26 pm on Jan 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok, I just did this:

<style type="text/css">
<!--
A:link { color: #dddddd; text-decoration: underline; background: #333333}
A:active { color: #0099ff; text-decoration: underline; }
A:visited { color: #dddddd; text-decoration: underline; }
A:hover { color: #ffffff; text-decoration: none; }
-->
</style>

(the cell colour is dark grey actually)
If I leave this in:

<body bgcolor="black" text="white" link="dddddd">

just to be sure, will it be acceptable? It seems to render fine in IE6 and Netscape 4.73

This is much appreciated. I love this place.

DrDoc

8:39 pm on Jan 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Acceptable? Well, it entirely depends on the DOCTYPE you want to validate against ..

To be perfectly honest though, and please don't take offense, it is not a wise thing to do if you're facing the future.

All the W3C standards are pointing towards a separation of style and content. Let CSS take care of style, while HTML take care of content formatting.

I would leave the BODY tag blank ..

Either way, the color

dddddd
should have a # in front of it. It is also better to avoid named colors and always use the RGB hex codes.

On a completely other note, when defining basic anchor styles, you don't need to define them using

a:link
.. in fact, it should be just
a

Not all browsers recognize

a:link
.. and even if they do,
a
is enough. It will cover everything left out (such as
a:focus
.. or other browsers specific ones)

Stefan

8:57 pm on Jan 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks DrDoc

The doctype is <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

I'll take your advice and start adding #'s and getting rid of :link's. These are my first experiments with CSS. It took a while just to get my head wrapped around HTML.

DrDoc

4:46 am on Jan 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It takes a little while to get used to separating CSS and HTML, but you'll see how much easier it will make things in the end ;)

More than worth it! :)

Hester

9:27 am on Jan 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Surely a search engine just registers the text! Colours are irrelevant no? Black on black will still be indexed.

DrDoc

9:32 am on Jan 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, Hester .. with these new smart SE's we never know, do we? Besides, it's better to be on the safe side. And, it's still considered good style to define color and background color at the same time, making sure they go well together.

Stefan

3:42 am on Jan 31, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The CSS for style, and html for content, seems the way to go. I just got paranoid about destroying my internal linking somehow due to sheer ignorance. The Google freshbot started on index.htm, then took all the pages through PR5, not long after I got advice and put backgrounds for the links in the style entry etc, so it seems it worked.

I don't want to get too fancy until I know what i'm doing.