SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do I get an h2 tag to wrap around an image?

    I want the h2 heading on this page: http://berkshirespas.com/wordpress/about/ to wrap around the image (video) to the right. I floated the image.

    The CSS is
    Code:
     #content-rightbox {
        display: block;
        float: right;
        padding-left: 5px;
        margin: 0px 0px 0px 10px;
    }
    The HTML is
    HTML Code:
    <div id="content-rightbox"><iframe width="400" height="225" src="http://www.youtube.com/embed/A97WaKNwvso?rel=0" frameborder="0" allowfullscreen></iframe></div>
    <h2>Lorem ipsum dolor sit amet</h2>
    What am I missing?
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  2. #2
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,888
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    You've got a CSS line somewhere that sets clear:both; on all heading elements (h1–6), which is what is pushing the <h2> down below the floated <div>.

  3. #3
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,221
    Mentioned
    457 Post(s)
    Tagged
    8 Thread(s)
    Yes, as Stevie said, it's the clear: both on line 36 of your style.css style sheet. Just remove that line.

  4. #4
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. That worked!
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  5. #5
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Learning more CSS... fixed it!

    Quote Originally Posted by Stevie D View Post
    You've got a CSS line somewhere that sets clear:both; on all heading elements (h16), which is what is pushing the <h2> down below the floated <div>.
    This fixed it for me too:

    Code:
    H1, H2, H3, H4, H5, H6
    {
    	clear: none !important;
    }
    Thanks!!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •