Jump to content

Archived

This topic is now archived and is closed to further replies.

redarrow

is it possable to set the background-color and color to valadate as valadated.

Recommended Posts

Hi there all hope alls ok.

Is it possable to get the css to validate as valid css if you set the background-color and color the same or do you have to do some fancy work as inherit but how?

example
[code]
P
{
color:red;
background-color:red;
}
[/code]

As you no if you set the color and background color the same you get warnings form valadation w3c has anyone found a way to stop the warnings and set both as the same color for background color and color.

Thank you.



Share this post


Link to post
Share on other sites
why would you want to do such a thing? You can do it with javascript.

Share this post


Link to post
Share on other sites
so what your say is to countinue to set other colors within p div ect ect.

Share this post


Link to post
Share on other sites
ok i see thanks solved and yes i look at javascript method later ok cheers.

Share this post


Link to post
Share on other sites
see my example below i dont think the font color will be yellow as color is red so i got to set another p to get the color yellow madness ?
[code]

P
{
color:red;
background-color:red;
font-color: yellow;
}
[/code]

Share this post


Link to post
Share on other sites
There is no font-color option

Use color to set the color of the text

ANd no you cant set text to have two colors in the same class/id/element

Share this post


Link to post
Share on other sites
sorry i posted that wrong and yes you see the situation i put my self under and thank you i think i under stand know.

Share this post


Link to post
Share on other sites
another thing as i am going throw the tutoral i am creating and also reading the css bible it states that shorthand code is not recomended but what your reel world fellings.

Share this post


Link to post
Share on other sites
I believe that for colors there is a value option called transparent. You could use that for the color attribute.

Share this post


Link to post
Share on other sites
can you give me an example of the code for transparent for the color property thank you.

Share this post


Link to post
Share on other sites
Thank you wildteen.

wildteen or someone can exsplain why do guru say dont use tables and use the css atubutes.

i use tables and css in all my coding and it is fully valadated and well designed have i got to change my method know as i am getting into css or can i still use my good old tables for design purpose.

Share this post


Link to post
Share on other sites
Tables are not ment for layouts. They are mean for displaying tabular data, such as showing temeraters throughout the year.

Tabled layouts are easy to do yes. However for me tableless layouts are a lot easier. Plus you get the benefit of coding less HTML, smaller file sizes. You can get a two colmn layout with a header done with just 3 div tags and a few lines of CSS. Where as if its tables it'll be more like 10 or more tags.

CSS is specifically designed to style your layouts. Not HTML. HTML is just the blue print of your website.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.