<h1> spacing

Discussion in 'HTML' started by richard, Jan 9, 2008.

  1. richard

    richard Guest

    <center><h1>sample</h1></center>
    <center><h2>text</h2><h3>line 2</h3></center>
    <center><h3>line 3</h3></center>
    <center>
    blah blah<br>
    yada yada<br>
    </center>


    Given this short example of code, how does one go about eliminating
    the extraneous space left between the <h(n)> tags?
    So that "line 2" would appear directly under "text" as any natural
    line would.
     
    richard, Jan 9, 2008
    #1
    1. Advertising

  2. richard

    asdf Guest

    "richard" <> wrote in message
    news:...
    >
    > <center><h1>sample</h1></center>
    > <center><h2>text</h2><h3>line 2</h3></center>
    > <center><h3>line 3</h3></center>
    > <center>
    > blah blah<br>
    > yada yada<br>
    > </center>
    >
    >
    > Given this short example of code, how does one go about eliminating
    > the extraneous space left between the <h(n)> tags?
    > So that "line 2" would appear directly under "text" as any natural
    > line would.


    css:

    h1, h2, h3, h4, h5, h6 {
    padding: 0;
    margin: 0;
    }

    Of course, one wouldn't do this if one was following the credo of semantic
    markup.

    Headings have nothing to do with appearance, and everything to do with
    logical document structure.
     
    asdf, Jan 9, 2008
    #2
    1. Advertising

  3. richard

    dorayme Guest

    In article <>,
    richard <> wrote:

    > <center><h1>sample</h1></center>
    > <center><h2>text</h2><h3>line 2</h3></center>
    > <center><h3>line 3</h3></center>
    > <center>
    > blah blah<br>
    > yada yada<br>
    > </center>
    >
    >
    > Given this short example of code, how does one go about eliminating
    > the extraneous space left between the <h(n)> tags?
    > So that "line 2" would appear directly under "text" as any natural
    > line would.


    You would not use center because you would control the problem
    you are concerned with by specifying padding and margins for your
    heading elements, especially the top and bottom margins, and
    while at it would do the job of centering the headings (if they
    are short headings, text-align: center will do).

    --
    dorayme
     
    dorayme, Jan 9, 2008
    #3
  4. richard

    richard Guest

    On Wed, 09 Jan 2008 00:01:39 -0500, richard <>
    wrote:

    >
    ><center><h1>sample</h1></center>
    ><center><h2>text</h2><h3>line 2</h3></center>
    ><center><h3>line 3</h3></center>
    ><center>
    >blah blah<br>
    >yada yada<br>
    ></center>
    >
    >
    >Given this short example of code, how does one go about eliminating
    >the extraneous space left between the <h(n)> tags?
    >So that "line 2" would appear directly under "text" as any natural
    >line would.


    Just to see what would happen, I included a <span
    style="font-size:75%;"> tag and it appears to do what I want quite
    well.
     
    richard, Jan 9, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Craig Deelsnyder [MVP]

    Re: Spacing radio buttons in a PlaceHolder

    Craig Deelsnyder [MVP], Jul 15, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    426
    Craig Deelsnyder [MVP]
    Jul 15, 2003
  2. Stephan Bour

    Row spacing in DataList

    Stephan Bour, Dec 8, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    557
    Stephan Bour
    Dec 8, 2003
  3. Greg Linwood

    Spacing columns in DataGrid

    Greg Linwood, Dec 18, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    673
    Greg Linwood
    Dec 19, 2003
  4. KatB
    Replies:
    1
    Views:
    592
    Lucas Tam
    Oct 5, 2004
  5. KatB
    Replies:
    4
    Views:
    840
Loading...

Share This Page