SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Nov 2009
    Posts
    328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    <p>'s will wrap around div but not <h2>'s???

    Hi all,

    I'm experiencing a peculiar problem.

    I have a right floating div which holds some Web 2.0 type buttons. I've managed to get the paragraphs (text in <p> tags) to wrap round the left of it nicely but nothing will cause a h2 header (<h2>) to do the same. All instances of h2's only appear right at the bottom of the aforementioned right floated div.

    The same happens in all major browsers.

    Just what gives? Any ideas anyone?

    Here's the CSS I'm using:

    Code CSS:
    #share-container-vertical {
    	float: right; 
    	width: 55px;			
    	margin: 0px 0px 15px 23px;
    	padding: 6px 4px 0px 4px;
    	border: solid #00A3CB 1px;		
    	-webkit-border-radius: 9px;
    	-moz-border-radius: 9px;
    	border-radius: 9px;		
    }
     
    h1, h2, h3, h4, h5, h6 { font-family: Arial, Helvetica, sans-serif; clear: both;}
     
    h2 {			
    	color: #191919;
    	font-size: 26px; 
    	text-transform: uppercase;
    	margin-bottom: 20px;
    }
     
    p {
    	line-height: 22px;
    	font-size: 14px;
    	font-weight: normal;
    	text-transform: none;		
    }

    Many thanks,

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,603
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    clear: both;

    that tells it to go under any floats rather than next to it.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Addict
    Join Date
    Nov 2009
    Posts
    328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    clear: both;

    that tells it to go under any floats rather than next to it.
    I changed/forced the h2 to do a clear: none and it works fine now, thanks.

  4. #4
    SitePoint Addict
    Join Date
    Nov 2009
    Posts
    328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks to you both.

    Changed the h2 to clear: none and it now works fine.


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
  •