how to not insert a new line after <dt> in a <dl> ?

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

    how to not insert a new line after <dt> in a <dl> ?

    I think browsers do it pretty much by default. How can you avoid that?

    It just doesn't look right/pretty for short definitions and also how
    can you not indent the whole <dd> so that in stead of looking like
    this:

    <code>
    _ _ _ term: def def def def def def ...
    _ _ _ _ _ _ def def def def def def ...
    </code>

    it would look like:

    <code>
    _ _ _ term: def def def def def def ...
    _ def def def def def def def def def ...
    </code>

    That is it would not indent the whole def to the right passed the term

    Thanks
    otf

  • Els

    #2
    Re: how to not insert a new line after &lt;dt&gt; in a &lt;dl&gt; ?

    onetitfemme wrote:

    [subjectline: How to not insert a new line after <dt> in a <dl>?][color=blue]
    > I think browsers do it pretty much by default. How can you avoid that?[/color]

    In your stylesheet:
    dt{float:left;c lear:left;}
    [color=blue]
    > It just doesn't look right/pretty for short definitions and also how
    > can you not indent the whole <dd> so that in stead of looking like
    > this:
    >
    > <code>
    > _ _ _ term: def def def def def def ...
    > _ _ _ _ _ _ def def def def def def ...
    > </code>
    >
    > it would look like:
    >
    > <code>
    > _ _ _ term: def def def def def def ...
    > _ def def def def def def def def def ...
    > </code>
    >
    > That is it would not indent the whole def to the right passed the term[/color]

    In your stylesheet:
    dd{margin-left:0;}
    [color=blue]
    > Thanks[/color]

    You're welcome :-)

    --
    Els http://locusmeus.com/
    Sonhos vem. Sonhos vão. O resto é imperfeito.
    - Renato Russo -

    Comment

    • Jukka K. Korpela

      #3
      Re: how to not insert a new line after &lt;dt&gt; in a &lt;dl&gt; ?

      onetitfemme wrote:
      [color=blue]
      > I think browsers do it pretty much by default.[/color]

      Browsers do "it" pretty much by default? One of the oddest statements
      about doing "it" I've seen. If you didn't mean "it", you should have
      specified what you mean. (Note: it is bad practice to refer to a heading
      in the copy text of a message, article, web page, or anything.)
      [color=blue]
      > How can you avoid that?[/color]

      If "that" means means "a new line after <dt>", then there's nothing to
      be avoided. There is no new line. Just some margin or padding, which may
      look like a line to an untrained eye, especially if you don't pay
      attention to the fact that there is no spoo... I mean line. Can you have
      a line of text without any text?

      If you mean the vertical spacing, i.e. the vertical margin or padding,
      then surely you know how to work with them in CSS. What exactly did you
      try? URL?

      On the other hand, which browser uses a default bottom margin or padding
      for <dt>? You seem to be asking for help with a vaguely described
      problem that does not exist.

      Or did you mean you don't want even a line break after <dt>, i.e. you'd
      like to have the definition start at the same line? That would be odd,
      and your sketchy example does not support this idea.

      The simple answer is "don't use <dl>", and it's mostly correct, since
      mostly people have not got a list of _definitions_ (i.e., _terms_ with
      their _definitions_) when they use <dl>.
      [color=blue]
      > It just doesn't look right/pretty for short definitions and also how
      > can you not indent the whole <dd> so that in stead of looking like
      > this:
      >
      > <code>
      > _ _ _ term: def def def def def def ...
      > _ _ _ _ _ _ def def def def def def ...
      > </code>[/color]

      Well, it has no new line. What _is_ the problem? And what's that <code>
      stuff there?
      [color=blue]
      > it would look like:
      >
      > <code>
      > _ _ _ term: def def def def def def ...
      > _ def def def def def def def def def ...
      > </code>
      >
      > That is it would not indent the whole def to the right passed the term[/color]

      This is far too vague. Why don't you post a URL and specify exactly what
      you would like to change in the default appearance (on some browsers)?

      Besides, the <dl> element is so widely abused for mixed name/value pairs
      that contain no definitions whatsoever that it's not particularly useful
      semantically. If you add the observed fact that its default renderings
      have idiosyncracies and are difficult to tune with CSS, the question
      arises why you use it.

      Using just e.g.

      <p><dfn>Term: </dfn> def def def...</p>

      might be a better starting point. You would not have much unexpected and
      unpredictable default rendering, and you could play with margin-left and
      text-indent for the paragraphs. Of course you could also use a <ul>
      instead of a sequence of <p> elements, but if the definitions are long,
      simple paragraphs might be more natural.

      Comment

      • Barbara de Zoete

        #4
        Re: how to not insert a new line after &lt;dt&gt; in a &lt;dl&gt; ?

        On Sun, 29 Jan 2006 14:09:36 +0100, onetitfemme
        <onetitfemme200 5@yahoo.com> wrote:
        [color=blue]
        > It just doesn't look right/pretty for short definitions and also how
        > can you not indent the whole <dd> so that in stead of looking like
        > this:
        >
        > <code>
        > _ _ _ term: def def def def def def ...
        > _ _ _ _ _ _ def def def def def def ...
        > </code>
        >
        > it would look like:
        >
        > <code>
        > _ _ _ term: def def def def def def ...
        > _ def def def def def def def def def ...
        > </code>[/color]

        I set up an example (only tested it in Opera) at
        <URL:http://www.pretletters .net/_test/styling_definit ion_lists.html> . That
        could help you.




        --
        ______PretLette rs:
        | weblog | http://www.pretletters.net/_private/weblog.html |
        | webontwerp | http://www.pretletters.net/html/webontwerp.html |
        |zweefvliegen | http://www.pretletters.net/html/vliegen.html |

        Comment

        • Alan J. Flavell

          #5
          Re: how to not insert a new line after &lt;dt&gt; in a &lt;dl&gt; ?

          On Sun, 29 Jan 2006, Jukka K. Korpela wrote:
          [color=blue]
          > Besides, the <dl> element is so widely abused for mixed name/value
          > pairs that contain no definitions whatsoever that it's not
          > particularly useful semantically.[/color]

          I think we agree on the observations; but I'm not sure that everyone
          has to draw the same conclusion from it. The HTML/4.01 specification
          already suggests a plausible application of the markup which quite
          obviously is not a "definition ":

          ||Another application of DL, for example, is for marking up dialogues,
          ||with each DT naming a speaker, and each DD containing his or her
          ||words.

          which would fail the strict semantic test.

          Given that many of the uses of <dl> that are observed "in the field"
          (excluding those which are obviously so far adrift as to be bogus)
          can be interpreted constructively as groups of "term and values", even
          if they are beyond the borderline as regards your personal standards
          of "definition ", I think it's possible to accept a rather wider
          interpretation of this markup for practical purposes.

          You may parse that as me saying "since so many others are abusing it,
          then I may as well abuse it myself", but I'd prefer to apply a more
          positive and constructive interpretation than that.

          I'm not saying the HTML/4.01 spec is always right - indeed I know that
          in some places it effectively contradicts itself - but in this case I
          think its acceptance of a wider semantic for <dl> isn't so bad as your
          consistently expressed views about it.

          IMHO and YMMV, of course.

          Comment

          • onetitfemme

            #6
            Re: how to not insert a new line after &lt;dt&gt; in a &lt;dl&gt; ?

            C'mon Jukka, I think you understood me just fine

            I think I will be going for your suggestion (as coocked by me ;-))
            looking more like:

            <code>


            <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
            dir="ltr">

            <head>
            <title>list test</title>
            <meta http-equiv="Content-Style-Type" content="text/css" />
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

            <style type="text/css">

            div.float {
            float: left;
            margin-left: 10px;
            margin-right: 10px;
            }

            div.float p { text-align: center; }

            span.trm {
            text-indent: 0.50em;
            font-weight: bold;
            }

            ul li p.def {
            text-indent: 0.00em;
            margin-top: 0px;
            margin-down: 0px;
            }

            p{
            text-indent: 1.50em;
            margin-top: 0px;
            margin-down: 0px;
            }

            </style>
            </head>

            <body>

            <span style="horizont al-align: center;">
            <div> <!-- float container -->
            <div class="float">
            <img src="image1.gif " width="100" height="100" alt="image 1" /><br />
            <p>caption 1</p>
            </div>

            <div class="float">
            <img src="image2.gif " width="100" height="100" alt="image 2" /><br />
            <p>caption 2</p>
            </div>

            <div class="float">
            <img src="image3.gif " width="100" height="100" alt="image 3" /><br />
            <p>caption 3</p>
            </div>

            <!-- clearing floating container -->
            <div style="clear: both;"></div>
            </div>
            </span>

            <hr />

            <ul>
            <li><p class="def"><sp an class="trm">Ter m 1</span>: def1 ...</p></li>
            <li><p class="def"><sp an class="trm">Ter m 2</span>: def2 ...</p></li>
            <li><p class="def"><sp an class="trm">Ter m 3</span>: def3 ...</p></li>
            </ul>

            <p>This is a freely standing paragraph</p>

            <html>


            </code>

            I still wasn't able to center the three images on the top even if
            floating to the left

            I you go "div.float { float: center; }" you would destroy the
            floating
            [color=blue]
            > (Note: it is bad practice to refer to a heading in the copy text of a message, article, web page, or anything.)[/color]
            However, my postwas very short; anyone could get what I meant with
            "it" ;-)

            Thanks
            otf

            Comment

            • Jukka K. Korpela

              #7
              Re: how to not insert a new line after &lt;dt&gt; in a &lt;dl&gt; ?

              "onetitfemm e" <onetitfemme200 5@yahoo.com> wrote:
              [color=blue]
              > C'mon Jukka, I think you understood me just fine[/color]

              No I didn't, and I refuse to be on a first-name basis with an anonymous
              poster.
              [color=blue]
              > I think I will be going for your suggestion (as coocked by me ;-))[/color]

              You misspelled "misunderstood" . Your tag sallad does not tell what you are
              trying to accomplish, and since you refuse to post the URL, you refuse to be
              helped. HAND.

              --
              Yucca, http://www.cs.tut.fi/~jkorpela/

              Comment

              • Gérard Talbot

                #8
                Re: how to not insert a new line after &lt;dt&gt; in a &lt;dl&gt; ?

                onetitfemme wrote :[color=blue]
                > I think browsers do it pretty much by default. How can you avoid that?
                >[/color]

                If a wide majority of browsers do "it" by default, then is it in your
                best interests as a web author to modify "it", to code against "it"?
                That is assuming of course that you are using <dt> and <dl> accordingly
                to begin with.
                [color=blue]
                > It just doesn't look right/pretty for short definitions[/color]

                Is a short definition still implying a definition term and definition
                data? If so, then what's wrong with applying the best semantic markup to
                a page situation? Looking right/pretty does not apply and should not
                apply; best semantic markup should apply.


                and also how[color=blue]
                > can you not indent the whole <dd> so that in stead of looking like
                > this:
                >
                > <code>
                > _ _ _ term: def def def def def def ...
                > _ _ _ _ _ _ def def def def def def ...
                > </code>
                >
                > it would look like:
                >
                > <code>
                > _ _ _ term: def def def def def def ...
                > _ def def def def def def def def def ...
                > </code>
                >[/color]

                dt { display: compact; }
                dd { margin-left: 0; }

                Gérard
                --
                remove blah to email me

                Comment

                • Gérard Talbot

                  #9
                  Re: how to not insert a new line after &lt;dt&gt; in a &lt;dl&gt; ?

                  Gérard Talbot wrote :
                  [color=blue]
                  > dt { display: compact; }
                  > dd { margin-left: 0; }[/color]

                  Even better:

                  dt {font-weight: bolder; display: run-in;}
                  dd {margin-bottom: 0;}



                  Gérard
                  --
                  remove blah to email me

                  Comment

                  • Barbara de Zoete

                    #10
                    Re: how to not insert a new line after &lt;dt&gt; in a &lt;dl&gt; ?

                    On Sun, 29 Jan 2006 23:01:08 +0100, Gérard Talbot
                    <newsblahgroup@ gtalbot.org> wrote:
                    [color=blue][color=green]
                    >> <code>
                    >> _ _ _ term: def def def def def def ...
                    >> _ def def def def def def def def def ...
                    >> </code>
                    >>[/color]
                    >
                    > dt { display: compact; }
                    > dd { margin-left: 0; }[/color]

                    Doesn't seem to do anything. At least it doesn't create a definition list
                    looking like the 'ascii art' example provided by OP. I tried and added
                    these styles to my example page. Go see
                    <URL:http://www.pretletters .net/_test/styling_definit ion_lists.html> .
                    You're the third example in that page.

                    [color=blue]
                    > Gérard
                    > --
                    > remove blah to email me[/color]

                    Your sig sep is broken. And before you start telling me that mine is too,
                    it has something to de with Thunderbird 1.5 you use. It is buggy somehow
                    with signature blocks. Don't ask me why/how, 'cause I don't know any more.

                    --
                    ______PretLette rs:
                    | weblog | http://www.pretletters.net/_private/weblog.html |
                    | webontwerp | http://www.pretletters.net/html/webontwerp.html |
                    |zweefvliegen | http://www.pretletters.net/html/vliegen.html |

                    Comment

                    • Barbara de Zoete

                      #11
                      Re: how to not insert a new line after &lt;dt&gt; in a &lt;dl&gt; ?

                      On Sun, 29 Jan 2006 23:25:09 +0100, Gérard Talbot
                      <newsblahgroup@ gtalbot.org> wrote:
                      [color=blue]
                      > Gérard Talbot wrote :
                      >[color=green]
                      >> dt { display: compact; }
                      >> dd { margin-left: 0; }[/color]
                      >
                      > Even better:
                      >
                      > dt {font-weight: bolder; display: run-in;}
                      > dd {margin-bottom: 0;}
                      >
                      > http://www.w3.org/TR/CSS21/visuren.html#run-in[/color]

                      Which does indeed work in Opera, but doesn't in Internet Exlorer (if you
                      care about that), but also doesn't seem to work in Firefox1.5 (which is a
                      bit more worrying).

                      Again:
                      <URL:http://www.pretletters .net/_test/styling_definit ion_lists.html> , this
                      time the fourth example.


                      --
                      ______PretLette rs:
                      | weblog | http://www.pretletters.net/_private/weblog.html |
                      | webontwerp | http://www.pretletters.net/html/webontwerp.html |
                      |zweefvliegen | http://www.pretletters.net/html/vliegen.html |

                      Comment

                      • onetitfemme

                        #12
                        Re: how to not insert a new line after &lt;dt&gt; in a &lt;dl&gt; ?

                        I think Yucca's proposal is best and it will be the one I will be
                        using. Browsers out there are very "free" indeed interpreting something
                        as simple as a the layout of a list (which IMHO shouldn't be much of a
                        deal).

                        From the browsers I have access to right now:
                        ._ Gecko/20050911 Firefox/1.0.6 does NOT
                        Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050911
                        Firefox/1.0.6 (Debian package 1.0.6-5)
                        ..
                        ._ Konqueror 3.4.1 (Using KDE 3.4.1) takes is just find
                        ._ Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20051111
                        Firefox/1.5 takes it OK also
                        ..
                        I still had a question on how to center, as a group, say, three
                        pictures that have been laid out floating to the left each. Here is a
                        link to a demo page:
                        ..
                        Latest news coverage, email, free stock quotes, live scores and video are just the beginning. Discover more every day at Yahoo!

                        ..
                        Also Yucca, bro, take it easy. Here, in public on line fora, people's
                        names are "mingo", "snow_white ", "onetitfemm e" or whatever they feel
                        like going by. I don't think that it really matters. Thing is that the
                        immediacy that the Internet gives us is good, I think. I wouldn't know
                        of any other way to treat you than your screen name and I sincerely
                        wondered what your qualms where about.
                        ..
                        otf

                        Comment

                        • Jim Moe

                          #13
                          Re: how to not insert a new line after &lt;dt&gt; in a &lt;dl&gt; ?

                          onetitfemme wrote:[color=blue]
                          > .
                          > I still had a question on how to center, as a group, say, three
                          > pictures that have been laid out floating to the left each.
                          > .[/color]
                          Then why did you float them left?
                          You could put the images in a div, make the div just wide enough for the
                          images, and center the div. No floating involved.

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

                          Comment

                          • cis148@yahoo.com

                            #14
                            Re: how to not insert a new line after &lt;dt&gt; in a &lt;dl&gt; ?

                            You misspelled "salad."

                            Yucky, http://www.yuckycorpulent.com

                            Comment

                            Working...