Talk Blogging - Blog Community Forum

Talk Blogging

Premium Blog Forum

How do I stop text wrapping around an image using CSS style? I'm building a

This is a discussion on How do I stop text wrapping around an image using CSS style? I'm building a within the Blog Theme Talk forums, part of the News and Announcements category; WordPress theme.? I would like to stop text flowing underneath the thumbnail image on this page (GIF) http://www.onepagereview....






Go Back   Talk Blogging - Blog Community Forum > News and Announcements > Blog Theme Talk

Members List Mark Forums Read
  #1  
Old 3rd-September-2007, 02:19 AM
T O T O is offline
Junior Member
 
Join Date: Sep 2007
Posts: 1
Default How do I stop text wrapping around an image using CSS style? I'm building a




WordPress theme.? I would like to stop text flowing underneath the thumbnail image on this page (GIF) http://www.onepagereview.com/blog/wp-content/themes/Restaurant%20Review/images/working2.gif

Please help.

>> This is the CSS applied to the 'thumb'

.thumb
{
float: left;
margin-left:5px;
margin-top:4px;
margin-right:25px;
background-color: #fff;
white-space:nowrap;
}

>> This is the HTML (WordPress)

<div class="thumb"><a href="<?php the_permalink() ?>"><?php post_image(); ?></a></div>
<div class="post" id="post-<?php the_ID(); ?>">

<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>

...etc

Thank you
Reply With Quote
  #2  
Old 3rd-September-2007, 02:19 AM
cdiem's Avatar
Junior Member
 
Join Date: Sep 2007
Posts: 1
Default


Hi there,

it will depend on how long your posts will be, if they are all going to be short like in the example screenshot pic you posted, then you can try adding a margin-bottom to the .thumb class, like:

.thumb
{
float: left;
margin-left:5px;
margin-top:4px;
margin-right:25px;
margin-bottom: 25px;
background-color: #fff;
white-space:nowrap;
}

but this won't work for very long posts, so you would have to either use tables or some other CSS trick

for example, if you set both .thumb and .post to float: left AND specify a width for both divs, that would work

.thumb
{
float: left;
width: 100px
}

.post
{
float: left;
width: 300px
}
Reply With Quote

Voice | Articles | Baton Rouge
Powered by vBulletin® Version 3.7.2
SEO Forum | Domain Forum | Verizon Ringtones

1 2 3 4 5 6 7 8 9 10 11