papillonstudios Posted May 11, 2011 Share Posted May 11, 2011 I want to have text for a certain element to wrap around an image(#content .body img) in the same element. the image is positioned relative. the reason for positioning the DIV relative is if i use float:left; the image is removed from the containing DIV(#content .body). If i set the text(#content .body p) to display:inline then is partially wraps the text(first line wraps around the bottom of the image). Is there anything I can do to wrap the text around the image? #content .body { position:relative; top:60px; left:15px; background: rgba(0, 0, 0, 0.6); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000); -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)"; max-width:650px; -webkit-border-radius:15px; -moz-border-radius:15px; border-radius:15px; } #content .body img { position:relative; top:15px; left:15px; margin-right:15px; margin-bottom:15px; } #content .body p { position:inherit; padding:10px; font-size:14px; text-indent:20px; display:inline; } <div id="contentContainer"> <div id="navigation"> <ul> <li><a href="#">News</a></li> <li><a href="#">Reviews</a></li> <li><a href="#">Videos</a></li> <li><a href="#" id="active">Downloads</a></li> <li><a href="#">Contact</a></li> </ul> <img id="divider" src="images/divider.png"/> </div> <div id="content"> <div class="title"> <h2>Google I/O 2011</h2> </div> <div class="body"> <img src="images/icecream.png" /> <p>At the live keynote, Google announced 2 new versions of it's Android OS. First the 3.1 update for Android Hunnycomb and the next big release Android Ice Cream Sandwich or Android 4. This version of Android is going to include many new features. First is Google is standardizing the Android Platform across all devices, this means that the same OS that is on Android phones with also be on Android Tablets. This new OS is going to have all the features of Android 3, but optimized to work on both Tablets and Phones. <a href="#">READ MORE</a></p> </div> </div> </div> Quote Link to comment https://forums.phpfreaks.com/topic/236066-wrap-text-around-relative-positioned-div/ Share on other sites More sharing options...
cssfreakie Posted May 11, 2011 Share Posted May 11, 2011 have a look at this post: http://www.phpfreaks.com/forums/index.php?topic=332086.0 ...... Quote Link to comment https://forums.phpfreaks.com/topic/236066-wrap-text-around-relative-positioned-div/#findComment-1213750 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.