Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS - Formatting a specific paragraph type

    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?

  • #2
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just use a header, afterall, it's what they're meant for !

    h4 {
    color: #F00;
    }

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

  • #3
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •