Help with DIV - how to eliminate carriage return

Discussion in 'HTML' started by michaaal, Aug 6, 2004.

  1. michaaal

    michaaal Guest

    When I use this code...

    <div style="background-color:yellow;color:red;">Order Today</div> and
    receive 10% off!

    The "and receive..." starts at the next line. How can I prevent this from
    starting at the next line? I would like for it to be a continuous line but
    only have "Order Today" in red with the yellow background.
     
    michaaal, Aug 6, 2004
    #1
    1. Advertising

  2. michaaal

    Jeff Thies Guest

    michaaal wrote:
    > When I use this code...
    >
    > <div style="background-color:yellow;color:red;">Order Today</div> and
    > receive 10% off!
    >
    > The "and receive..." starts at the next line. How can I prevent this from
    > starting at the next line? I would like for it to be a continuous line but
    > only have "Order Today" in red with the yellow background.


    use span instaed of a div.

    You can also add display: inline , but what you really have is a span,
    so make it a span.

    Jeff
    >
    >
     
    Jeff Thies, Aug 6, 2004
    #2
    1. Advertising

  3. Jeff Thies <> wrote:

    >> <div style="background-color:yellow;color:red;">Order Today</div>
    >> and receive 10% off!

    - -
    > use span instaed of a div.
    >
    > You can also add display: inline , but what you really have is a
    > span, so make it a span.


    To me, it looks very much like strong emphasis, so <strong> would be the
    adequate markup. Besides, it would result in highlighted presentation
    even on browsers that do not support CSS, or have CSS support disabled.

    <span> says 'hi, I'm an inline text container, and my author found no
    adequate semantic (or even physical) markup for my content, so I was
    called to duty, to carry some attribute(s)'.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
     
    Jukka K. Korpela, Aug 6, 2004
    #3
  4. michaaal

    Toby Inkster Guest

    michaaal wrote:

    > <div style="background-color:yellow;color:red;">Order Today</div> and
    > receive 10% off!


    <p><strong style="background-color:yellow;color:red;font-weight:normal;">
    Order Today</strong> and receive 10% off!</p>

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Aug 6, 2004
    #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. Pia
    Replies:
    5
    Views:
    4,785
  2. K Viltersten

    <div ... /> and <div ...></div>

    K Viltersten, Mar 30, 2009, in forum: ASP .Net
    Replies:
    4
    Views:
    813
  3. Xeno Campanoli
    Replies:
    0
    Views:
    248
    Xeno Campanoli
    Feb 13, 2006
  4. Steve Anderson
    Replies:
    3
    Views:
    283
    Steve Anderson
    Jun 21, 2004
  5. Dwayne Madsen

    Q: Div A inside Div B is larger than Div B

    Dwayne Madsen, Jun 1, 2005, in forum: Javascript
    Replies:
    1
    Views:
    242
    David Dorward
    Jun 1, 2005
Loading...

Share This Page