You might want to highlight some text within a paragraph to give it special attention. To highlight text within a paragraph, place the text to be highlighted within a <span> element, and set style properties of the span. This CSS quick reference article shows several ways to highlight text.
Welcome to Bucaro TecHelp!

Welcome to Bucaro TecHelp!
Maintain Your Computer and Use it More Effectively
to Design a Web Site and Make Money on the Web

[About BTH]  [User Agreement]  [Privacy Policy]  [Site Map]  [Contact Form]  [Advertise on BTH]  [News Feed]

Google
Web
This Site

Highlight Text

You might want to highlight some text within a paragraph to give it special attention. To highlight text within a paragraph, place the text to be highlighted within a <span> element, and set the color property of the span to the highlight color. The example below shows text highlighted with the color red.

<p>"But I don't want to go among mad people," Alice remarked. "Oh, you can't help that," said the Cat: <span style="color: red;">"we're all mad here. I'm mad. You're mad."</span> "How do you know I'm mad?" said Alice. "You must be," said the Cat, "or you wouldn't have come here." - Alice and the Cheshire Cat in Alice In Wonderland by Lewis Carroll.</p>

"But I don't want to go among mad people," Alice remarked. "Oh, you can't help that," said the Cat: "we're all mad here. I'm mad. You're mad." "How do you know I'm mad?" said Alice. "You must be," said the Cat, "or you wouldn't have come here." - Alice and the Cheshire Cat in Alice In Wonderland by Lewis Carroll.

Some people define "highlighting" as changing its background color. To highlight text within a paragraph by changing its background color, place the text within a <span> element, and set the background-color property of the span to the highlight color. The example below shows text highlighted with the color yellow.

<p>"But I don't want to go among mad people," Alice remarked. "Oh, you can't help that," said the Cat: <span style="background-color: yellow;">"we're all mad here. I'm mad. You're mad."</span> "How do you know I'm mad?" said Alice. "You must be," said the Cat, "or you wouldn't have come here." - Alice and the Cheshire Cat in Alice In Wonderland by Lewis Carroll.</p>

"But I don't want to go among mad people," Alice remarked. "Oh, you can't help that," said the Cat: "we're all mad here. I'm mad. You're mad." "How do you know I'm mad?" said Alice. "You must be," said the Cat, "or you wouldn't have come here." - Alice and the Cheshire Cat in Alice In Wonderland by Lewis Carroll.

The above examples use inline style. You can also highlight text by defining a style class in an embedded style block or in an external linked style sheet. The example below shows a style class named highlight applied to a span.

<style type="text/css">
.highlight
{
font-weight:bold;
color: red;
background-color: yellow;
}
</style>

<p>"But I don't want to go among mad people," Alice remarked. "Oh, you can't help that," said the Cat: "we're all mad here. I'm mad. You're mad." <span class="highlight">"How do you know I'm mad?" said Alice.</span> "You must be," said the Cat, "or you wouldn't have come here." - Alice and the Cheshire Cat in Alice In Wonderland by Lewis Carroll.</p>

"But I don't want to go among mad people," Alice remarked. "Oh, you can't help that," said the Cat: "we're all mad here. I'm mad. You're mad." "How do you know I'm mad?" said Alice. "You must be," said the Cat, "or you wouldn't have come here." - Alice and the Cheshire Cat in Alice In Wonderland by Lewis Carroll.

Note that in the style class I defined highlight as meaning; make the text bold, a different color, and with a different color background. Too much?

You might want to highlight some text within a paragraph to give it special attention. To highlight text within a paragraph, place the text to be highlighted within a <span> element, and set style properties of the span.

Earn $1 to $5 to complete survey

Web Design Sections
CSS Quick Reference
Use Inline Style
Use an Embedded Style Sheet
Use an External Style Sheet
CSS Units of Measurement
Specifying Color
Set the Text Color
Set the Text Alignment
Set the Letter Spacing
Set the Word Spacing
Set the Line Spacing
Highlight Text
Indent the First Line of Text
Set the Text Decoration
Set Text Justification
Set the Font Family
Set the Font Style
Set the Font Boldness
Set the Font Size
Set the Font Variant
Style the First Letter
Style the First Line
Set the Background Color
Set a Background Image
Set a Background Image's Position
Set a Fixed Background Image
Set the Background Properties
Set the Border Properties
Set the Border Style
Set the Border Width
Set the Border Color
Set an Element's Margin
Set an Element's Padding
Set an Element's Clipping
Set an Element's Overflow
Set an Element's Position
Set an Element's Float
Color the Scrollbar
Set an Element's Overlap
Set an Element's Visibility
Vertical Align an Element
Define CSS Rollover Effects
Web Designer's Reference
[Site User Agreement]  [Advertise on This site]  [Search This Site]  [Contact Form]
Copyright©2001-2007 Bucaro TecHelp P.O.Box 18952 Fountain Hills, AZ 85269