SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard jax502's Avatar
    Join Date
    Jul 2003
    Location
    Jacksonville, FL
    Posts
    1,031
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    unwanted line breaks

    I'm not sure how to get rid of the extra white line when I use <p> after <h1>.

    For example, <h1>title</h1>
    <p class="content">blahblahblah
    blahblahblah</p>

    it appears like this

    title
    <---------- I want this extra space removed.
    blahblahblah
    blahblahblah

    I'm using CSS and I don't know what to add on my
    .content {

    }
    to fix this. Is there any other solution to this? Thanks a million!
    jax502

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Code:
    h1 {
      margin-bottom: 0;
    }
    .content {
      margin-top: 0;
    }
    You have to remove the top margin of the paragraph AND the bottom margin of the h1 to have no space. My CSS above does just that.

  3. #3
    SitePoint Wizard jax502's Avatar
    Join Date
    Jul 2003
    Location
    Jacksonville, FL
    Posts
    1,031
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a million, vgarcia!
    jax502


Bookmarks

Posting Permissions

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