CSS/HTML Text On Same Line Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oshaughd
    New Member
    • Aug 2007
    • 1

    CSS/HTML Text On Same Line Question

    I am new to CSS and something is driving me crazy.
    I was asked to remove a font tag and change it to CSS.

    original code:
    <p><font> color="#008080" >Submitted By: /font> <i>Your Name</i></p>

    Change To CSS:
    p {color:#008080; }
    <p> Submitted by: </p> <i>Dawn O'Shaughnessy</i>

    The Submitted By and my name should be 2 different colors--Got that part!!!

    However, I cannot get my name to appear on the same line as Submitted By.
    Shows Up Like This? Why?? Many Thanks! Dawn

    Submitted by:

    Dawn O'Shaughnessy
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    <p> is a block level element that occupies the entire width of the page. So you need to shorten the length by adding 'width:100px' or whatever and then 'float:left' which will allow your name to start to the right.

    Comment

    • just a feeling
      New Member
      • Aug 2007
      • 86

      #3
      Try this,

      [HTML]p {
      color: #008080;
      }
      em {
      color: #FF00CC;
      }
      <p>Submitted by <em>Dawn O'Shaughnessy</em></p>[/HTML]

      Comment

      Working...