1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

<h2> text </h2> to appear within the paragraph

Discussion in 'HTML & Website Design' started by imnajam, Sep 8, 2007.

  1. #1
    Hi allz,

    Just like we normally bold things in between paragraph, I would like to use <h2> tag and format it with css identifier, the problem I am facing is the text between h2 tag is displayed in separate paragraph breaks paragraph(line break).

    Anyone know how can I use h2 tag without line break?

    Thanks in advance
     
    imnajam, Sep 8, 2007 IP
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You need to have both the container for the header (ie the H2) and for the text after to have display: Inline set. if the text after isnt in a container then put it within a span
     
    AstarothSolutions, Sep 8, 2007 IP
    imnajam likes this.
  3. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #3
    But what's the point? Isn't it better to just make a <span> with css making a bold style and large font?
     
    Stomme poes, Sep 8, 2007 IP
    imnajam likes this.
  4. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I think they want the SEO element of h2
     
    AstarothSolutions, Sep 8, 2007 IP
  5. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #5
    Float the h2.
     
    soulscratch, Sep 8, 2007 IP
    imnajam likes this.
  6. Xabber

    Xabber Active Member

    Messages:
    437
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
    #6
    h2 {
    display: inline;
    }

    Is that what you mean ?
     
    Xabber, Sep 8, 2007 IP
    imnajam likes this.
  7. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #7
    If you make the header display inline, you won't be able to assign it any dimensions.. so if you were to do something fancy like a background image it wouldn't work like a normal block level element.. if you float it then you can still set dimensions, have background images work properly, etc.
     
    soulscratch, Sep 8, 2007 IP
  8. imnajam

    imnajam Well-Known Member

    Messages:
    2,389
    Likes Received:
    113
    Best Answers:
    0
    Trophy Points:
    185
    #8
    Thank you all for your response, and sorry for responding delay(actually I didn't get my instant email notification of reply to this thread)

    today I tried to do <h2 style="display: inline"> some text here </h2> but it's still shown on a separate line.

    Can anybody explain me a little more if I want to do something similar to this what could be the solution.
     
    imnajam, Sep 12, 2007 IP
  9. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #9
    Uhm... if it's a header, shouldn't you be closing the paragraph, doing the header then opening the paragraph? MAYBE you should be using a grouping DIV instead of a para?

    I'm not getting the point of the question I guess. Sounds like you are trying to make something that won't validate.
     
    deathshadow, Sep 12, 2007 IP
    imnajam likes this.
  10. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #10
    You can make it validate by online validation scripts but it isnt using tags as they are intended and long term may risk Google black listing for underhand tactics.
     
    AstarothSolutions, Sep 14, 2007 IP
  11. imnajam

    imnajam Well-Known Member

    Messages:
    2,389
    Likes Received:
    113
    Best Answers:
    0
    Trophy Points:
    185
    #11
    ok so as per suggestion I have taken my thought down of implementing this.

    Thanks all for the feed backs
     
    imnajam, Sep 15, 2007 IP