Hello, I've been teaching myself XHTML/CSS and I've learned a lot but for some reason I can't seem to change a font color at the end of a paragraph. Can anybody help? I've tried using spans but for some reason I can't get it to work. Basically I want to change the price in brackets to blue: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean sollicitudin. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. ($5.00) Any advice would be appreciated. Thanks everyone!
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean sollicitudin. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. <span style="color:#0000FF;">($5.00)</span></p> Code (markup):
Thanks for that it works fine. I'm using external style sheets so I've been trying to do this without putting any CSS in the XHTML, e.g. <span class="blue">($5.00)</span> .blue { color: #0000FF; } But I can't get this to work. Am I doing something wrong?
that's odd, try this ... <style> <!-- .blue { color: #0000FF; } --> </style> </head> <body> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean sollicitudin.Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. <span class="blue">($5.00)</span></p> </body> </html> Code (markup):
I would check to see if you have a ID or a !important declaration that could be overriding that class in the css.