Why does float:right cause a line break ?

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

    Why does float:right cause a line break ?

    Why does float:right cause a line break? Try the code below. Is there a
    fix? I want the link on the same line as the text. Thanks


    <html>
    <head>
    <STYLE>
    span.linkpos { float:right; clear: none; color:blue; }
    </style>
    </head>

    <table border 1px >
    <tr>
    <td>
    Source for configuration management documents and drawings from many
    projects. These are primarily engineering design documents. Each
    Directorate must be searched separately...
    <span class=linkpos>
    <a href=details. php?id=3&Type_v iew= detail&Type_Sub mit=&key_word= >see
    details</a>
    </span>
    </td>
    </tr>
    </table>
    <html>
  • David Dorward

    #2
    Re: Why does float:right cause a line break ?

    leegold wrote:
    [color=blue]
    > Why does float:right cause a line break?[/color]

    It (in effect) gives whatever you apply it to display:block. Elements with
    display:block have line breaks before them.

    --
    David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is

    Comment

    • Chris Leipold

      #3
      Re: Why does float:right cause a line break ?

      Hi,

      leegold wrote:[color=blue]
      > Why does float:right cause a line break? Try the code below. Is there a
      > fix? I want the link on the same line as the text. Thanks[/color]
      You have to write it this way:

      <td>
      <span class=linkpos>
      <a href=details. php?id=3&Type_v iew= detail&Type_Sub mit=&key_word= see
      details</a>
      </span>
      Source for configuration management documents and drawings from many
      projects. These are primarily engineering design documents. Each
      Directorate must be searched separately...
      </td>

      The float has to be before the static element, otherwise your browser
      does not recognize where to float...

      Chris

      Comment

      • Evertjan.

        #4
        Re: Why does float:right cause a line break ?

        Chris Leipold wrote on 08 mrt 2005 in
        comp.infosystem s.www.authoring.stylesheets:
        [color=blue]
        > leegold wrote:[color=green]
        >> Why does float:right cause a line break? Try the code below. Is there a
        >> fix? I want the link on the same line as the text. Thanks[/color]
        > You have to write it this way:
        >
        > <td>
        > <span class=linkpos>
        > <a href=details. php?id=3&Type_v iew= detail&Type_Sub mit=&key_word= see
        > details</a>
        > </span>
        > Source for configuration management documents and drawings from many
        > projects. These are primarily engineering design documents. Each
        > Directorate must be searched separately...
        > </td>
        >
        > The float has to be before the static element, otherwise your browser
        > does not recognize where to float...
        >[/color]

        Floating an inline element like <span> is illogical,
        therefore browsers seem to change it to a block element.

        Better use a <div>.

        --
        Evertjan.
        The Netherlands.
        (Replace all crosses with dots in my emailaddress)

        Comment

        • Richard

          #5
          Re: Why does float:right cause a line break ?

          On Mon, 07 Mar 2005 22:37:09 -0500 leegold wrote:
          [color=blue]
          > Why does float:right cause a line break? Try the code below. Is there a
          > fix? I want the link on the same line as the text. Thanks
          >
          >
          > <html>
          > <head>
          > <STYLE>
          >.......span.li nkpos { float:right; clear: none; color:blue; }[/color]
          ............... ............... ............... ..........^^^^^ ^^^^

          not needed here.
          you're saying float the item right then immediately clear it which has the
          effect of cancelling the float.

          <table border 1px >

          Wrong syntax.
          border says either show or hide the borders. Value of 1 shows, all others
          hide.

          Should be <table style="border:s olid 1px blue;">

          Scrap the table.
          <div>........te xt.......<span> <a>...lnk text...</a></span</div>





          Comment

          • kchayka

            #6
            Re: Why does float:right cause a line break ?

            Richard wrote:[color=blue]
            > On Mon, 07 Mar 2005 22:37:09 -0500 leegold wrote:
            >[color=green]
            >>.......span.l inkpos { float:right; clear: none; color:blue; }[/color]
            >
            > not needed here.
            > you're saying float the item right then immediately clear it which has the
            > effect of cancelling the float.[/color]

            You obviously don't understand either the float or clear properties.

            It boggles my mind how you can continually spew forth crap like this
            without batting an eye. Have you ever bothered to read the specs to see
            if any of your assumptions are even remotely valid? Don't bother
            answering because it's quite obvious you haven't.

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

            Comment

            • goldtech@worldpost.com

              #7
              Re: Why does float:right cause a line break ?


              kchayka wrote:
              snip...[color=blue]
              > It boggles my mind how you can continually spew forth crap like this
              > without batting an eye. Have you ever bothered to read the specs to[/color]
              see[color=blue]
              > if any of your assumptions are even remotely valid? Don't bother
              > answering because it's quite obvious you haven't.[/color]

              kchayka or what ever you weird name is,
              I can bet on one thing for sure: you live alone and have very few
              friends!
              Now go away Troll to your little room!

              Comment

              • kchayka

                #8
                Re: Why does float:right cause a line break ?

                goldtech@worldp ost.com wrote:[color=blue]
                >
                > Now go away Troll to your little room![/color]

                You must be new around here. ;)

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

                Comment

                • goldtech@worldpost.com

                  #9
                  Re: Why does float:right cause a line break ?

                  I'm new and confused.

                  I am sorry and apologize for the verbage - the troll stuff - I thought
                  you were directing your questioning at me - then I read the thread
                  again and saw a poster was saying some absolutely crazy obviously
                  made-up stuff and you were just responding to him/her.

                  kchayka,
                  I am sorry again.

                  Goldtech

                  Comment

                  • kchayka

                    #10
                    Re: Why does float:right cause a line break ?

                    goldtech@worldp ost.com wrote:[color=blue]
                    >
                    > I am sorry and apologize for the verbage - the troll stuff - I thought
                    > you were directing your questioning at me[/color]

                    That's why it's important to retain the attribution ("somebody wrote:")
                    when you reply. FYI, google groups does not automatically quote replies,
                    so these are dropped from your posts. You should either stop using
                    google groups to post to usenet, or change the options so it
                    automatically quotes when you reply.
                    [color=blue]
                    > kchayka,
                    > I am sorry again.[/color]

                    Thanks for that, but I didn't take it personally. I usually wear my
                    flame-retardant teflon suit around here. ;)

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

                    Comment

                    Working...