minidiapolis
Dec 13 2006, 04:27 PM
Hello,
I hope you don't mind one last question. . .
it's my understanding you should put everything in quotes like this:
<p style = "color:blue;
font family: arial">
but how would you do it if you needed to use quotes inside that block of code like
<p style = "background-image:
url()">
Darin McGrew
Dec 13 2006, 04:39 PM
In this case, I would move the CSS to a style sheet and use a CLASS or ID attribute rather than the STYLE attribute.
But in general, you can use
character entity references like " or "
pandy
Dec 14 2006, 01:17 AM
Or you alternate double and single quote pairs.
BTW url() doesn't need quotes.
factor
Dec 15 2006, 11:02 AM
As Darin said the best solution is to use classes, it can be more meaningful if you'd use for eg. <p class="blue">. Use semantic markup whenever you can.
pandy
Dec 15 2006, 11:18 AM
Except "blue" isn't semantic.
factor
Dec 15 2006, 01:02 PM
You can interpret my last sentence as a separate advice
Darin McGrew
Dec 15 2006, 03:25 PM
Just to be perfectly clear for the original poster:
<p class="blue"> is a poor example of a CLASS value. It's better to ask why you want the paragraph to be blue, and to use a CLASS value that reflects that meaning.
For example, if you want all brillig paragraphs to be blue, then you could use <p class="brillig">. Later, when you decide to make all your brillig paragraphs green instead, you can change just the style sheet. Otherwise, you'll either need to change all your HTML, or you'll end up in the confusing situation where <p class="blue"> is colored green.
minidiapolis
Dec 15 2006, 03:33 PM
I really appreciate all your help
factor
Dec 15 2006, 03:59 PM
Thanks Darin to pointing that out, it really makes sense.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.