headers and <br>s

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • meltedown

    headers and <br>s

    Earlier, there was a discussion of why not to use <br>s too much. I
    mostly don't like using <br>s at all but there is one situation where
    its seems better than the alternative.

    <h4> this is the paragraph header</h4>
    <p> this is the paragraph</p>

    If I want no margin between the header and the paragraph, I can use:
    <h4 class='no_botto m_margin'> this is the paragraph header</h4>
    <p class='no_top_m argin'> this is the paragraph</p>

    But this is sometimes more obnoxious than

    <p>
    <span class='paragrap hheader'>this is the paragraph header</span>
    <br>
    this is the paragraph</p>

    How would you do this ?
  • Jim Moe

    #2
    Re: headers and &lt;br&gt;s

    meltedown wrote:[color=blue]
    >
    > <h4> this is the paragraph header</h4>
    > <p> this is the paragraph</p>
    >
    > If I want no margin between the header and the paragraph, I can use:
    > <h4 class='no_botto m_margin'> this is the paragraph header</h4>
    > <p class='no_top_m argin'> this is the paragraph</p>
    >
    > But this is sometimes more obnoxious than
    >[/color]
    "Obnoxious? " Why?
    [color=blue]
    > <p>
    > <span class='paragrap hheader'>this is the paragraph header</span>
    > <br>
    > this is the paragraph</p>
    >[/color]
    This removes useful markup from your content. The header becomes just a
    modified form of body text and less for non-visual browsers to process.
    And changing header styles does not affect that text style increasing your
    maintenance burden.
    Do you use the gapless presentation randomly? Or does it tend to clump
    together?
    Hey! You could use a division and cascade the h4 and p elements so no
    explicit class attribute is required.

    --
    jmm (hyphen) list (at) sohnen-moe (dot) com
    (Remove .AXSPAMGN for email)

    Comment

    • Arne

      #3
      Re: headers and &lt;br&gt;s

      Once upon a time *meltedown* wrote:
      [color=blue]
      > Earlier, there was a discussion of why not to use <br>s too much. I
      > mostly don't like using <br>s at all but there is one situation where
      > its seems better than the alternative.
      >
      > <h4> this is the paragraph header</h4>
      > <p> this is the paragraph</p>
      >
      > If I want no margin between the header and the paragraph, I can use:
      > <h4 class='no_botto m_margin'> this is the paragraph header</h4>
      > <p class='no_top_m argin'> this is the paragraph</p>
      >
      > But this is sometimes more obnoxious than
      >
      > <p>
      > <span class='paragrap hheader'>this is the paragraph header</span>
      > <br>
      > this is the paragraph</p>
      >
      > How would you do this ?[/color]

      If that header and paragraph is an exeption, different from other
      paragraps and <h4> headers on the site, then I use just <h4
      style="blablabl a"> and <p style="blabla">

      But I always try to give all header tags their own style, in the
      stylesheet file, e.g. h1 {margin-bottom:12px;} and so on. Less margin
      for smaller (sub)headers and use them the same way all over the site.

      For the paragraph tag, I mostly set top-margin to "0px" and only use a
      bottom-margin to make a space before the next paragraph. That way I
      can have a header and a following paragraph with the margins I like.

      --
      /Arne
      -- *Joke of the day* ----------------------------------------
      Tech Support: What anti-virus program do you use?
      Customer: Netscape.
      Tech Support: That's not an anti-virus program.
      Customer: Oh, sorry...Interne t Explorer.
      -------------------------------------------------------------

      Comment

      • meltedown

        #4
        Re: headers and &lt;br&gt;s

        Jim Moe wrote:[color=blue]
        > meltedown wrote:
        >[color=green]
        >>
        >> <h4> this is the paragraph header</h4>
        >> <p> this is the paragraph</p>
        >>
        >> If I want no margin between the header and the paragraph, I can use:
        >> <h4 class='no_botto m_margin'> this is the paragraph header</h4>
        >> <p class='no_top_m argin'> this is the paragraph</p>
        >>
        >> But this is sometimes more obnoxious than
        >>[/color]
        > "Obnoxious? " Why?[/color]

        Just that adding all those classes to the tags is a chore. I'll do it
        rather than using <br>'s (it seems like I'm giving up control of my text
        when anything is not in a block element). I just thought there might be
        a shortcut I hadn't thought of.

        [color=blue]
        >[color=green]
        >> <p>
        >> <span class='paragrap hheader'>this is the paragraph header</span>
        >> <br>
        >> this is the paragraph</p>
        >>[/color]
        > This removes useful markup from your content. The header becomes just
        > a modified form of body text and less for non-visual browsers to
        > process. And changing header styles does not affect that text style
        > increasing your maintenance burden.
        > Do you use the gapless presentation randomly? Or does it tend to clump
        > together?
        > Hey! You could use a division and cascade the h4 and p elements so no
        > explicit class attribute is required.
        >[/color]

        I guess that could work if all the paragraphs were that way, but there
        are always more paragraphs below the one next to the header. All the
        header are the same so it would at least cut down on the need to cite
        header classes.

        Comment

        • meltedown

          #5
          Re: headers and &lt;br&gt;s

          Arne wrote:[color=blue]
          > Once upon a time *meltedown* wrote:
          >
          >[color=green]
          >>Earlier, there was a discussion of why not to use <br>s too much. I
          >>mostly don't like using <br>s at all but there is one situation where
          >>its seems better than the alternative.
          >>
          >><h4> this is the paragraph header</h4>
          >><p> this is the paragraph</p>
          >>
          >>If I want no margin between the header and the paragraph, I can use:
          >><h4 class='no_botto m_margin'> this is the paragraph header</h4>
          >><p class='no_top_m argin'> this is the paragraph</p>
          >>
          >>But this is sometimes more obnoxious than
          >>
          >><p>
          >><span class='paragrap hheader'>this is the paragraph header</span>
          >><br>
          >>this is the paragraph</p>
          >>
          >>How would you do this ?[/color]
          >
          >
          > If that header and paragraph is an exeption, different from other
          > paragraps and <h4> headers on the site, then I use just <h4
          > style="blablabl a"> and <p style="blabla">
          >
          > But I always try to give all header tags their own style, in the
          > stylesheet file, e.g. h1 {margin-bottom:12px;} and so on. Less margin
          > for smaller (sub)headers and use them the same way all over the site.
          >
          > For the paragraph tag, I mostly set top-margin to "0px" and only use a
          > bottom-margin to make a space before the next paragraph. That way I
          > can have a header and a following paragraph with the margins I like.
          >[/color]
          That's a good tip, that might be the shortcut I'm looking for. Thanks.

          Comment

          • kchayka

            #6
            Re: headers and &lt;br&gt;s

            meltedown wrote:[color=blue]
            > Jim Moe wrote:[color=green]
            >> meltedown wrote:
            >>[color=darkred]
            >>> <h4 class='no_botto m_margin'> this is the paragraph header</h4>
            >>> <p class='no_top_m argin'> this is the paragraph</p>[/color][/color]
            >
            > there
            > are always more paragraphs below the one next to the header.[/color]

            Class selectors aren't required. I think someone else already suggested
            this:

            h4 {margin-bottom: 0;}
            p {margin-top: 0; margin-bottom: 1em;}

            I do this all the time, on ol/ul as well as paragraphs. Works very nicely.

            --
            Reply email address is a bottomless spam bucket.
            Please reply to the group so everyone can share.

            Comment

            • meltedown

              #7
              Re: headers and &lt;br&gt;s

              kchayka wrote:[color=blue]
              > meltedown wrote:
              >[color=green]
              >>Jim Moe wrote:
              >>[color=darkred]
              >>>meltedown wrote:
              >>>
              >>>
              >>>><h4 class='no_botto m_margin'> this is the paragraph header</h4>
              >>>><p class='no_top_m argin'> this is the paragraph</p>[/color]
              >>
              >>there
              >>are always more paragraphs below the one next to the header.[/color]
              >
              >
              > Class selectors aren't required. I think someone else already suggested
              > this:
              >
              > h4 {margin-bottom: 0;}
              > p {margin-top: 0; margin-bottom: 1em;}
              >
              > I do this all the time, on ol/ul as well as paragraphs. Works very nicely.
              >[/color]
              OK thanks, I think I got the hang of it. I used to know this too.

              Comment

              • Jim Moe

                #8
                Re: headers and &lt;br&gt;s

                meltedown wrote:[color=blue][color=green]
                >> Do you use the gapless presentation randomly? Or does it tend to
                >> clump together?
                >> Hey! You could use a division and cascade the h4 and p elements so
                >> no explicit class attribute is required.[/color]
                >
                > I guess that could work if all the paragraphs were that way, but there
                > are always more paragraphs below the one next to the header. All the
                > header are the same so it would at least cut down on the need to cite
                > header classes.
                >[/color]
                Sometimes you want space, sometimes you don't. I was curious how the
                space/no-space decision occurs: for a whole page? a small section of a
                page? Alternate sections? Randomly picked by source code? (Okay, the last
                one is unlikely. :-))

                --
                jmm (hyphen) list (at) sohnen-moe (dot) com
                (Remove .AXSPAMGN for email)

                Comment

                • meltedown

                  #9
                  Re: headers and &lt;br&gt;s

                  Jim Moe wrote:[color=blue]
                  > meltedown wrote:
                  >[color=green][color=darkred]
                  >>> Do you use the gapless presentation randomly? Or does it tend to
                  >>> clump together?
                  >>> Hey! You could use a division and cascade the h4 and p elements so
                  >>> no explicit class attribute is required.[/color]
                  >>
                  >>
                  >> I guess that could work if all the paragraphs were that way, but there
                  >> are always more paragraphs below the one next to the header. All the
                  >> header are the same so it would at least cut down on the need to cite
                  >> header classes.[/color]
                  >[color=green]
                  > >[/color]
                  > Sometimes you want space, sometimes you don't. I was curious how the
                  > space/no-space decision occurs: for a whole page? a small section of a
                  > page? Alternate sections? Randomly picked by source code? (Okay, the
                  > last one is unlikely. :-))
                  >[/color]
                  I want a space between everything but a header and a paragraph.
                  The stuff kchayka and Arne suggested is fine.
                  h4 {margin-bottom: 0;}
                  p {margin-top: 0; margin-bottom: 1em;}

                  Comment

                  • Alan J. Flavell

                    #10
                    Re: headers and &lt;br&gt;s

                    On Sat, 12 Nov 2005, meltedown wrote:
                    [color=blue]
                    > I want a space between everything but a header and a paragraph.
                    > The stuff kchayka and Arne suggested is fine.
                    > h4 {margin-bottom: 0;}
                    > p {margin-top: 0; margin-bottom: 1em;}[/color]

                    Have you seen
                    http://www.complexspiral.com/publica...psing-margins/ ?

                    Might help in understanding the available options.

                    Comment

                    • meltedown

                      #11
                      Re: headers and &lt;br&gt;s

                      Alan J. Flavell wrote:[color=blue]
                      > On Sat, 12 Nov 2005, meltedown wrote:
                      >
                      >[color=green]
                      >>I want a space between everything but a header and a paragraph.
                      >>The stuff kchayka and Arne suggested is fine.
                      >>h4 {margin-bottom: 0;}
                      >>p {margin-top: 0; margin-bottom: 1em;}[/color]
                      >
                      >
                      > Have you seen
                      > http://www.complexspiral.com/publica...psing-margins/ ?
                      >
                      > Might help in understanding the available options.
                      >[/color]
                      No I had't seen it. I always wondered why the headers didn't have top
                      margins in a div. It has tasted my patience more than once. Thanks.

                      Comment

                      • meltedown

                        #12
                        Re: headers and &lt;br&gt;s

                        meltedown wrote:[color=blue]
                        > Alan J. Flavell wrote:
                        >[color=green]
                        >> On Sat, 12 Nov 2005, meltedown wrote:
                        >>
                        >>[color=darkred]
                        >>> I want a space between everything but a header and a paragraph.
                        >>> The stuff kchayka and Arne suggested is fine.
                        >>> h4 {margin-bottom: 0;}
                        >>> p {margin-top: 0; margin-bottom: 1em;}[/color]
                        >>
                        >>
                        >>
                        >> Have you seen
                        >> http://www.complexspiral.com/publica...psing-margins/ ?
                        >>
                        >> Might help in understanding the available options.
                        >>[/color]
                        > No I had't seen it. I always wondered why the headers didn't have top
                        > margins in a div. It has tasted my patience more than once. Thanks.[/color]


                        Actually, what that site says is complicated by the fact that the header
                        margins in firefox do not collapse like the header margins in figure 2.
                        Here for example, is a simple header in a div, with no styles


                        Comment

                        • kchayka

                          #13
                          Re: headers and &lt;br&gt;s

                          meltedown wrote:[color=blue]
                          >[color=green]
                          >> Alan J. Flavell wrote:[color=darkred]
                          >>>
                          >>> http://www.complexspiral.com/publica...psing-margins/ ?[/color][/color]
                          >
                          > Actually, what that site says is complicated by the fact that the header
                          > margins in firefox do not collapse like the header margins in figure 2.
                          >
                          > http://reenie.org/test/test13.htm[/color]

                          Results can be unpredictable when you trigger quirks mode:
                          <URL:http://hsivonen.iki.fi/doctype/>

                          --
                          Reply email address is a bottomless spam bucket.
                          Please reply to the group so everyone can share.

                          Comment

                          • meltedown

                            #14
                            Re: headers and &lt;br&gt;s

                            kchayka wrote:[color=blue]
                            > meltedown wrote:
                            >[color=green][color=darkred]
                            >>>Alan J. Flavell wrote:
                            >>>
                            >>>>http://www.complexspiral.com/publica...psing-margins/ ?[/color]
                            >>
                            >>Actually, what that site says is complicated by the fact that the header
                            >>margins in firefox do not collapse like the header margins in figure 2.
                            >>
                            >>http://reenie.org/test/test13.htm[/color]
                            >
                            >
                            > Results can be unpredictable when you trigger quirks mode:
                            > <URL:http://hsivonen.iki.fi/doctype/>
                            >[/color]
                            I added a strict doctype and the header margin still does not collapse
                            in firefox. http://reenie.org/test/test13.htm

                            Comment

                            Working...