Baxtex Posted April 4, 2011 Share Posted April 4, 2011 HelloI'm codeing CSS right now but i have run into a litte problem. W3C standards says that you got to enter the background color for a text if you use a differant color to the text itself. I already got a picture as a background for the whole page. So if i enter a background color for the text, it would look very stupid. Imagine a weird colord bar in the middle of the page. So, are there a way i can make this background color invisible? Link to comment Share on other sites More sharing options...
Spunky Posted April 4, 2011 Share Posted April 4, 2011 I'm codeing CSS right now but i have run into a litte problem. W3C standards says that you got to enter the background color for a text if you use a differant color to the text itself.Im not exactly sure what you mean by that or where you're getting it from, but, maybe then it just wants you to specify background color in which case maybe you could just do background-color: none;perhaps Link to comment Share on other sites More sharing options...
Ingolme Posted April 4, 2011 Share Posted April 4, 2011 You don't need to specify a background color. It's just a recommendation to make sure that your text is readable. Link to comment Share on other sites More sharing options...
Baxtex Posted April 5, 2011 Author Share Posted April 5, 2011 Aha! It was only i that misunderstood then? I quote from W3Schools: " For W3C compliant CSS: If you define the color property, you must also define the background-color property." But if i make one of my sentence with a background color, all of my sentences in my doucment get one. I just want just that one to have a background color. How do make just one with a backgorund color?I'm sorry for my bad English; But i wonder how to make a background color to for example a sentence. Beacuse when i do it, all of my sentences get a background color. Link to comment Share on other sites More sharing options...
trevelluk Posted April 5, 2011 Share Posted April 5, 2011 Probably the easiest way is to wrap the particular sentence you want to have a background colour in a <span> with a class you can target to set the background colour. Link to comment Share on other sites More sharing options...
Baxtex Posted April 5, 2011 Author Share Posted April 5, 2011 Thank you very much, used the span tag as you said and it only marked the words/sentences which was within the span tag. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.