Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using CSS to Edit Within HTML Element 3

Status
Not open for further replies.

ThoughtStream

Technical User
Apr 14, 2010
4
US
I have run into a bit of a confusing problem for me. I want to change the color of a single word within a <p> tag to have red font. I know how to do this using html using the <font color=""> tag, but I have been told that is depreciated (or soon will be) so I need to use CSS instead. This is the line I want to edit (with the <font color> that I want to replace with css)

<p>Select your preferred seating area<font color="red"> (below)</font> or <asp:HyperLink>Click Here</asp:HyperLink> to have the best seats chosen by the system</p>

But I cannot get it to only color the word "below" red. Such a simple thing, but it has me completely stumped

I'm open to any advice at this point.
 
Just surround the word with a span tag instead of a font tag and style that for instance:

Code:
<p>Select your preferred seating area<span style="color:red;"> (below)</span> or <asp:HyperLink>Click Here</asp:HyperLink> to have the best seats chosen by the system</p>



----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Of course, if color red is how you define your [tt]strong[/tt] or [tt]em[/tt]phasized text, maybe you can use appropriate tags and style them to always look like that. However, without knowing the structure of your pages, it's hard to tell if that's the appropriate way to go.

[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
Perfect! Thanks guys, the span tags work great!
@Vragabond - My boss just wanted me to edit that one word so that customers would notice it more easily, though I do appreciate the tip!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top