different font in the same line?

Discussion in 'CSS' started by expatCanuck, Aug 9, 2008.

  1. #1
    Greetings.

    New to CSS.

    I more or less grok the <h1><h2> ... <p> tag stuff.

    It seems that when I change a tag, it creates a new line.

    My question: can I have something appear in two different sizes without the line break?

    For example, I'd like something like this:

    I'd like to have something appear like this (and then this.)​

    But not this:

    I'd like to have something appear like this
    (but this should be on the same line as the previous text)​

    Wisdom welcome.

    Thanks.

    - Richard
    oldWithoutMoney dot com
     
    expatCanuck, Aug 9, 2008 IP
  2. norfstar

    norfstar Peon

    Messages:
    1,154
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try:

    <h2 style="display:inline;">I'd like to have something appear like this</h2> (and then this.)
    Code (markup):
     
    norfstar, Aug 9, 2008 IP
  3. expatCanuck

    expatCanuck Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks. Worked perfectly. (results can be seen in the middle of the left column here)
    oldwithoutmoney dot com​

    Cheers,

    - Richard
     
    expatCanuck, Aug 9, 2008 IP
  4. Website Tiger

    Website Tiger Guest

    Messages:
    351
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    if you using dreamweaver just highlight what ever you want different and it will automatically create a css .style font
     
    Website Tiger, Aug 9, 2008 IP
  5. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #5
    The way that was suggested to you is non-semantic, poorly structured and generally not good practice. What you actually did, is much better, and would be fine if you'd remove the style attribute (it doesn't need to be inline, anyway) and the <br>s following the <h4>. For example,
    
    <h4>(Sonic sketches (warts &amp; all) from the forthcoming CD,<br><i>Guitar Picks and Dog Biscuits</i>)</h4>
    Code (markup):
    It's a fourth level header, and the <i> tag has an implied semantic value due to the typographic convention of bolding or italicizing book, journal or album names. Article or song titles would be italicized or "quoted".

    You don't need the <br>s if you don't inline the header, a natural block level element. Spacing between it and the following element may be adjusted by varying margin values.

    I see no evidence of your using Dreamweaver. Good; keep it that way. You'll be better off.

    cheers,

    gary
     
    kk5st, Aug 9, 2008 IP