SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to remove newline after h1

    How can I remove the newline after text in a h1 tag? The text is in a table cell all by itself and there is a huge space under the h1 text that I want to remove. How can this be done?

  2. #2
    + platinum's Avatar
    Join Date
    Jun 2001
    Location
    Adelaide, Australia
    Posts
    6,441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In your CSS file, try...

    Code:
    h1
    {
    padding: 0px;
    margin: 0px;
    }
    not sure if it has both padding and a margin off hand, but I presume it probably does.


    Although just to throw another idea into the pot Have you considered applying it to the cell/table itself? Rather than around the text.

  3. #3
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Re: How to remove newline after h1

    Originally posted by keithd
    How can I remove the newline after text in a h1 tag? The text is in a table cell all by itself and there is a huge space under the h1 text that I want to remove. How can this be done?
    Code:
    <style type="text/css">
    h1 {
     display:inline;
    }
    </style>
    h1 is a block-level element though. I'd put your inline text within a <span> styled a certain way rather than in an h1 tag. It has more semantic meaning that way.

    --Vinnie

  4. #4
    SitePoint Wizard Ian Glass's Avatar
    Join Date
    Oct 2001
    Location
    Beyond yonder
    Posts
    2,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Re: How to remove newline after h1

    Originally posted by vgarcia
    I'd put your inline text within a <span> styled a certain way rather than in an h1 tag. It has more semantic meaning that way.
    Not if Keith's actually using <h1> to designate the main headline. <span> doesn't really have any meaning at all. :-)

    ~~Ian

  5. #5
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Re: Re: Re: How to remove newline after h1

    Originally posted by Ian Glass
    Not if Keith's actually using <h1> to designate the main headline. <span> doesn't really have any meaning at all. :-)

    ~~Ian
    That's what I meant, if his h1 is all for presentation and not for any particular meaning he should use a <span>, as it has no real meaning like you said.

    --Vinnie


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
  •