...

View Full Version : CSS - Formatting a specific paragraph type



Elisabet
08-20-2005, 05:54 PM
I have a document with a slew of paragraphs that need to look like this:

Paragraph Header
Text of the paragraph is here right underneath
and continues on for a few lines

Can I define in a single class that the first line of the paragraph needs to be bold and a diffrent color, or do I have to create 2 classes, one for the header and one for the text?

mark87
08-20-2005, 06:17 PM
Just use a header, afterall, it's what they're meant for !

h4 {
color: #F00;
}

<h4>Your Title</h4>
<p>Your Text</p>

Elisabet
08-20-2005, 08:00 PM
Thanks... I actually wanted to avoid seperating the text if possible and found my solution by doing

CSS:
.paragraph:first-line {
color: #3B5A6F;
font-weight: bold;
}

with HTML of:
<div class="paragraph">
Paragraph Header<br>
Text of the paragraph is here right underneath
and continues on for a few lines</div>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum