adding padding to a heading within a container that already has padding - html

I am currently trying to add padding to the heading of this container and for some reason it's not letting me add any padding to the left or right. The image below show what it looks like at the moment.
here is my code:
<?php
$feed = 'http://miletich2.blogspot.co.uk/feed/';
$rss = fetch_feed($feed);
?>
<div class="container">
<div class="clear">
<div class="right">
<div class="rss-container">
<div class="rss-heading">
<?php
$title = "Clashing With Life";
$description = 'This is a blog written by an autistic person for other autistic people about <br>some of the biggest issues in life, whether deplorable or marvelous.';
echo '<h3 class="text-center title">' . $title . '</h3>';
echo '<p class="text-center">' . $description . '</p>';
?>
</div>
<?php
if ( !is_wp_error($rss) ) :
$maxitems = $rss->get_item_quantity(3);
$rss_items = $rss->get_items(0, $maxitems);
if ($rss_items):
foreach ($rss_items as $item) :
$item_title = esc_attr( $item->get_title() );
$item_permalink = esc_url( $item->get_permalink() );
$item_post_date = $item->get_date( get_option('date_format') );
$item_excerpt = wp_trim_words( wp_strip_all_tags( $item->get_description(), true ), 50 );
echo sprintf('<div class="spacing">%s<div class="pull-right">%s</div><p>%s</p><hr></div>', $item_permalink, $item_title, $item_post_date, $item_excerpt);
endforeach;
endif;
endif;
?>
Here is my css:
.right{
float:right;
}
.rss-container{
max-width: 400px;
width: 100%;
margin: 25px auto;
background: #f4f4f4;
padding: 0 20px 0 20px;
}
.rss-heading {
background: #7ED321;
color: #000;
padding: 15px 30px;
border-radius: 6px 6px 0 0;
-webkit-border-radius: 6px 6px 0 0;
font-weight: bold;
}
.rss-heading p{
font-size:9px;
}
hr{
border-top: 1px solid #DCDCDC !important;
}
.article-head{
line-height: 2em;
font-family: Roboto Condensed;
font-weight: bold;
}
.clear{
clear:both;
}
.spacing a {
line-height: 2em;
font-size: 15px;
}
.pull-right{
line-height: 2em;
font-size: 15px;
}
h3.title {
font-family: Roboto Condensed !important;
font-weight: bold;
}
in .rss-container I added this: padding: 0 20px 0 20px;
and .rss-heading padding: 15px 30px; I tried to change 30px to another value since I just want it to change left and right and it continued to change top and bottom. Any help would be appreciated!

To change just the left and right padding values, you can't use the 'padding' shortcut. Explicitly specify:
padding-right: 30px;
padding-left: 30px;
That will leave top and bottom unchanged.

Related

Foreach loop position not working correctly

I'm trying to make a list with people that have been stored in a mysql database, however only the first database item is styled properly and the others are out of place. I'm fairly new with css and I probably made a mistake in the while loop or positioning.
https://i.imgur.com/cKJqT6s.png
Image ^^
The code that I'm using is as followed:
<div id="adminsummary">
<div id="admintitel">
<p id="admintext">Admin Overview</p>
</div>
<?php
while ($row = mysqli_fetch_array($result)) {
$steamid = $row["steamid"];
$xml = simplexml_load_file("http://steamcommunity.com/profiles/$steamid/?xml=1");
if (!empty($xml)) {
$username = $xml->steamID;
}
?>
<div id="admin">
<img id="adminimg" src="<?php echo $steamprofile['avatarmedium']; ?>">
<p id="adminname"><?php echo $username; ?></p>
<!-- <p id="adminname"> SteamID: <?php echo $row["steamid"]; ?></p> -->
<p id="adminname"> Rank: <?php if ($row["rank"] == 1) {echo "SuperAdmin";} else {echo "Admin";} ?></p>
<hr id="hr2">
</div>
</div>
The stylesheet:
#adminsummary {
background: white;
margin-top: 5%;
height: 75%;
width: 25%;
margin-right: 5%;
float:right;
border-radius: 25px;
box-shadow: 10px 10px 77px -6px rgba(0,0,0,0.59);
}
#admintitel{
background: #343a40;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
}
#admintext{
color: white;
font-family: sans-serif;
font-weight: bold;
text-align: center;
padding: 25px;
}
#adminimg {
border-radius: 25px;
float: left;
margin-left: 25px;
}
#hr2 {
display: block;
margin-top: 25px;
margin-bottom: 0.5em;
margin-left: auto;
margin-right: auto;
border-style: inset;
border-width: 1px;
}
#adminname {
text-align: left;
font-weight: bold;
margin-left: 25%;
font-family: sans-serif;
}
Thanks for taking the time to help me
Try putting classes instead of id in your divs and p inside the while loop.
IDs are unique in CSS, that explain why the first row is styled, not the others.
If you modify the HTML and remove the IDs within the loop you can use a combination of classes with child/sibling selectors to assign styles in a cleaner way
<!-- these IDs are OK as they are unique ( presumably ) -->
<div id="adminsummary">
<div id="admintitel">
<p id="admintext">Admin Overview</p>
</div>
<?php
while ($row = mysqli_fetch_array($result)) {
$steamid = $row["steamid"];
$xml = simplexml_load_file("http://steamcommunity.com/profiles/$steamid/?xml=1");
if (!empty($xml)) {
$username = $xml->steamID;
}
?>
<!-- use classes &/or sibling selectors for cleaner html ~ no duplicate IDs though -->
<div class="admin">
<img src="<?php echo $steamprofile['avatarmedium']; ?>">
<p><?php echo $username; ?></p>
<p> Rank: <?php if ($row["rank"] == 1) {echo "SuperAdmin";} else {echo "Admin";} ?></p>
<hr />
</div>
<?php
}//close loop
?>
</div>
the slightly modified CSS using child selectors to assign styles within the .admin code block
#adminsummary {
background: white;
margin-top: 5%;
height: 75%;
width: 25%;
margin-right: 5%;
float:right;
border-radius: 25px;
box-shadow: 10px 10px 77px -6px rgba(0,0,0,0.59);
}
#admintitel{
background: #343a40;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
}
#admintext{
color: white;
font-family: sans-serif;
font-weight: bold;
text-align: center;
padding: 25px;
}
#adminsummary .admin img {
border-radius: 25px;
float: left;
margin-left: 25px;
}
#adminsummary .admin hr {
display: block;
margin-top: 25px;
margin-bottom: 0.5em;
margin-left: auto;
margin-right: auto;
border-style: inset;
border-width: 1px;
}
#adminsummary .admin p {
text-align: left;
font-weight: bold;
margin-left: 25%;
font-family: sans-serif;
}

Responsive page is not working in table

Currently for this project i am using bootstrap and my personal css files. I have defined page wrapper class to differentiate between menu item and content.
The table is working fine in broad view. Working(desktop view)
But while in mobile view half of the content displayed in dark background
Mobile view(not working)
code:
Php code for the Page:
<?php
include "includes/header.php"
?>
<div id="wrapper">
<!-- Navigation Bar -->
<?php include "includes/navigation.php" ?>
<div id="page-wrapper">
<div class="container-fluid">
<?php
$query = "SELECT * FROM patent_details where sap_id='$sap'";
$result = mysqli_query( $conn, $query );?>
<!-- Page Heading -->
<div class="row">
<div class="col-lg-12">
<h1 class="page-header dash-head">
<center>Patent View</center> <!-- All data defined here-->
</h1>
<table class="table">
<thead>
<th>Patent ID</th>
<th>Author other than UPES</th>
<th>Department</th>
<th>File Application No</th>
<th>Filling Date</th>
<th>Country</th>
<th>Patent Status</th>
<th>Currency</th>
<th>Income Generated</th>
</thead>
<tbody>
<?php
if( mysqli_num_rows($result) > 0 ) {
while( $row = mysqli_fetch_assoc($result) ) {
$patent_id = $row['patent_id'];
$auther_other_than_UPES = $row['author_other_than_UPES'];
$department = $row['department'];
$file_application_no = $row['file_application_no'];
$filing_date = $row['filing_date'];
$country = $row['country'] ;
$patent_status = $row['patent_status'];
$currency = $row['currency'];
$income_generated = $row['faculty_income_generated_through_patents'];
echo "<tr>";
echo "<td>$patent_id</td>";
echo "<td>$auther_other_than_UPES</td>";
echo "<td>$department</td>";
echo "<td>$file_application_no</td>";
echo "<td>$filing_date</td>";
echo "<td>$country</td>";
echo "<td>$patent_status</td>";
echo "<td>$currency</td>";
echo "<td>$income_generated</td>";
echo "<td><a type='button' href='patent_edit.php?id=".$patent_id."' >Edit</a>;</td>";
echo "</tr>";
}
}
else {
echo "No data available";
}
?>
</tbody>
</table>
<?php include "includes/footer.php"
?>
CSS code for the page:
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
margin-top: 100px;
background-color: #222;
}
#media(min-width:768px) {
body {
margin-top: 50px;
}
}
#wrapper {
padding-left: 0;
}
#page-wrapper {
width: 100%;
padding: 0;
background-color: #fff;
}
#media(min-width:768px) {
#wrapper {
padding-left: 225px;
}
#page-wrapper {
padding: 10px;
}
}
/* Top Navigation */
.top-nav {
padding: 0 15px;
}
.top-nav>li {
display: inline-block;
float: left;
}
.top-nav>li>a {
padding-top: 15px;
padding-bottom: 15px;
line-height: 20px;
color: #999;
}
.top-nav>li>a:hover,
.top-nav>li>a:focus,
.top-nav>.open>a,
.top-nav>.open>a:hover,
.top-nav>.open>a:focus {
color: #fff;
background-color: #000;
}
.top-nav>.open>.dropdown-menu {
float: left;
position: absolute;
margin-top: 0;
border: 1px solid rgba(0,0,0,.15);
border-top-left-radius: 0;
border-top-right-radius: 0;
background-color: #fff;
-webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
box-shadow: 0 6px 12px rgba(0,0,0,.175);
}
.top-nav>.open>.dropdown-menu>li>a {
white-space: normal;
}
/* Side Navigation */
#media(min-width:768px) {
.side-nav {
position: fixed;
top: 51px;
left: 225px;
width: 225px;
margin-left: -225px;
border: none;
border-radius: 0;
overflow-y: auto;
background-color: #222;
}
.side-nav>li>a {
width: 225px;
}
.side-nav li a:hover,
.side-nav li a:focus {
outline: none;
background-color: #000 !important;
}
}
.side-nav>li>ul {
padding: 0;
}
.side-nav>li>ul>li>a {
display: block;
padding: 10px 15px 10px 38px;
text-decoration: none;
color: #999;
}
.side-nav>li>ul>li>a:hover {
color: #fff;
}
.navbar-inverse .navbar-brand {
color: #ff4500;
font-size: 25px;
}
.dash-head{
font-size: 40px;
color: #ff4703;
}
p{
font-size: 15px;
padding: 0;
}
.dash-list{
list-style: none;
}
footer {
position: fixed;
right: 0;
bottom: 0;
left: 0;
padding:0;
color: #fff;
background-color: #555;
text-align: center;
}
As you mentioned you are using bootstrap, in order to make your table responsive you should just make use of the classes available within the framework. I.e:
<table class='table table-responsive'>
//Rest of table here
</table>
You can find the complete documentation here: http://getbootstrap.com/css/#tables
Although you used bootstrap you haven't done anything to make the table responsive.
<div class="table-responsive">
<table class="table">
//Code
</table>
</div>
Use above mentioned code. I hope you will get what you wanted.

how to change only the body text

In my single wordpress posts I want to apply a padding of 100px to the left and right text. The problem is that when I apply it to .single .post-content the images also get a padding. However, I want all of the images on the posts pages to be set to 100%. Is there a way to separate the actual body text and the images? This seems like a fairly simple question. But I can't figure it out. Any help is appreciated.
single.php
<?php
get_header();
if (have_posts()) :
while (have_posts()) : the_post(); ?>
<article class="post">
<?php $featuredImage = wp_get_attachment_url( get_post_thumbnail_id($post->ID), 'full' ); ?>
<div class="banner" style="background:url(<?php echo $featuredImage; ?>) no-repeat;"></div>
<?php wpb_set_post_views(get_the_ID()); ?>
<div class="post-info">
<h1 class="post-title"><?php the_title(); ?></h1>
<h2 class="post-date"><?php echo strip_tags(get_the_term_list( $post->ID, 'location', 'Location: ', ', ', ' • ' ));?><?php the_date('F m, Y'); ?></h2>
</div>
<div class="post-content"><?php the_content(); ?></div>
<div id="wrapper-footer"><div class="post-footer"><h1 class="post-footer-comment"><?php comments_popup_link ('No Comments', '1 Comment', '% Comments', 'post-footer-comment-count', 'none'); ?></h1><div class="share"><span>share</span> <?php get_template_part( 'share-buttons-post' ); ?></div></div>
<div class="post-footer-bloglovin"><h1>never miss a post</h1><h2>follow on email'</h2></div></div>
<?php get_template_part( 'prevandnextpost' ); ?>
<?php get_template_part( 'related-posts' ); ?>
<?php comments_template(); ?>
</article>
<?php endwhile;
else :
echo '<p>No content found</p>';
endif;
get_footer();
?>
css
.single .post-title,
.post-title a,
.post-title a:link, .post-title a:visited {
font-family: 'Questrial', sans-serif;
font-size:30px;
margin-left:6px;
margin: 0 auto;
color:#000000;
margin-bottom: 3px;
margin-top:30px;
}
.single .post-date {
font-family: 'Questrial', sans-serif;
font-size:13px;
margin-left:6px;
margin: 0 auto;
color:#000000;
}
.single .post-content {
text-decoration: none;
color: #000000;
display: block;
font-family: 'Crimson Text', serif;
font-size: 18px;
margin:0 auto;
margin-top: -50px;
padding-left:100px;
padding-right:100px;
}
.single .post-info {
background:#ffffff;
padding-left: 100px;
padding-right:100px;
max-width: 1865px;
background-position:center;
background-clip: content-box;
margin: 0 auto;
height:110px;
bottom:100px;
position: relative;
}
.single img {
max-width:100%;
padding: 0 0 0 0 !important;
height:auto;
}
You are adding the padding to this selector (which searches for .post-content inside of .single element):
.single .post-content
Try wrapping text inside a p tag:
.post-content p {
padding-left:100px;
padding-right:100px;
}
Example below:
.post-content {
text-decoration: none;
color: #000000;
display: block;
font-family: 'Crimson Text', serif;
font-size: 18px;
margin: 0 auto;
margin-top: 0px;
/* padding-left: 100px; */
/* padding-right: 100px; */
width: 300px;
border: 1px solid gray;
}
.post-content p {
padding-left: 100px;
padding-right: 100px;
}
<div class="post-content">
<img src="https://placeholdit.imgix.net/~text?txtsize=33&txt=300×100&w=300&h=100" />
<p>TEST CONTENT TEST CONTENT OTHER TEST CONTENT TEST LONGER WORD</p>
</div>
if you defined:
.single .post-content {
...
padding-left:100px;
padding-right:100px;
}
and images are inside of .post-content, then you need to state a following rule:
.single img {
max-width:100%;
padding: 0 0 0 0 !important;
height:auto;
margin-left: -100px;
margin-right: -100px;
}

Beginner, div/css problems [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I have amended my code with the help from below but now
the images and text seem 'all over the place'. Some
behind the div background some infont, and the same
with the text as well as some text on the left,
some on the right.
I've taken screen shot to show, and
added requested html output below.
How it should look. http://i.stack.imgur.com/8O9uM.png
How it currently looks. http://i.stack.imgur.com/4GUfi.png
------------------------------
html output as requested
<div class="ind">2 Bedroom property in LL11</p><div class="bottom"><div class="des"><p>Situated close to Wrexham town centre, this two bedroom mid terrace has gas central heating and double glazing and provi.....</p><ul id="info"><li><img src='127.0.0.1/vebra/assets/icons/money_icon.png'><span>£105000</span></li><li><img src='127.0.0.1/vebra/assets/icons/bed_icon.png'><span>2 Bedrooms</span></li><li><img src='127.0.0.1/vebra/assets/icons/area_icon.png'><span>LL11</span></li></ul><h3><br><br><a href='127.0.0.1/forsale/105322_24718166'>View Property Details</h3></div></div></div>
------------------------------
php code
echo '<div class="ind">';
echo "<a href='127.0.0.1/forsale/".$row['AGENT_REF']."' class='left'><img src='127.0.0.1/vebra/assets/".$row['MEDIA_IMAGE_02']."' width='296px'></a><br />"; // home image and link
echo '<h3>';
echo $row['TOWN'];
echo '</h3>';
echo '<p class="area">';
echo $row['PRICE'] . " Bedroom property in ". $row['POSTCODE1'];
echo '</p>';
echo '<div class="bottom">';
echo '<div class="des">';
echo '<p>' .htmlentities(substr($row['SUMMARY'],0,120)).".....".'</p>'; // shorten description
echo '<ul id="info">'; // price bed postcode
echo "<li><img src='127.0.0.1/vebra/assets/icons/money_icon.png'><span>"."£" . $row['PROP_SUB_ID']."</span></li>";
echo "<li><img src='127.0.0.1/vebra/assets/icons/bed_icon.png'><span>". $row['PRICE'] . " Bedrooms"."</span></li>";
echo "<li><img src='127.0.0.1/vebra/assets/icons/area_icon.png'><span>". $row['POSTCODE1']."</span></li>";
echo '</ul>';
echo '<h3>' . "<br>" . "<br>";
echo "<a href='127.0.0.1/forsale/".$row['AGENT_REF']."'>View Property Details</a>";
echo '</h3>';
echo '</div>';
echo '</div>';
echo '</div>';
------------------------------
css code
/* Sales Results nb overflow:scroll; */
li img { width: 20px; }
.left {
float: left;
margin-right: 10px;
}
#sale_results { }
#sale_results .sale_content { background-color: #fff; padding: 20px; -webkit-border-radius: 10px; -khtml-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; position: relative; }
#sale_results .sale_content h2.pagetitle { font-size: 38px; line-height: 41px; margin: 0 0 3px 0; color: #C4DA4B; font-weight: bold; }
#sale_results .sale_content p.subtitle { font-size: 20px; line-height: 22px; margin: 0 0 20px 0; color: #9B9EA0; }
#sale_results .sale_content .ind { height: 221px; position: relative; border: 1px solid #dedede; width: 922px; margin: 0 20px 20px 0; background: #fff url(images/sub_page_bg.png) repeat-x bottom; }
#sale_results .sale_content .ind > img {width: 295px;}
#sale_results .sale_content .ind.last { margin: 0 0 20px 0; }
#sale_results .sale_content .ind .bottom { float:right; clear: left; padding: 19px 15px 15px; width: 588px; height:188px;}
#sale_results .sale_content .ind h3 { font-size: 20px; line-height: 22px; color: #575B5C; margin: 0 0 7px 0; font-weight: bold; }
#sale_results .sale_content .ind h3 a { color: #575B5C; }
#sale_results .sale_content .ind h3 a:hover { color: #333; }
#sale_results .sale_content .ind p.area { font-size: 14px; color: #9B9EA0; line-height: 16px; margin: 0 0 15px 0; }
#sale_results .sale_content .ind des { font-size: 12px; color: #9B9EA0; line-height: 16px; margin: 0 0 15px 0; }
#sale_results .sale_content ul#info { padding: 0; margin: 0; float: left; position: absolute; bottom: 61px;}
#sale_results .sale_content ul#info li { margin: 0 0 10px 0; float: left; width: 130px; padding:0; background: none; }
#sale_results .sale_content ul#info li img { float: left; width: 24px; height: 24px; margin: 0 10px 0 0; }
#sale_results .sale_content ul#info li span { font-size: 14px; font-weight: bold; color: #3B3E40; line-height: 24px; float: left; }
#sale_results .sale_content .ind a.view { background: url(images/view_more.png) no-repeat; position: absolute; bottom: 0; height: 39px; width: 265px; background-position: 0 0; font-size: 0px; line-height: 0px; text-indent: -9999px; border: none; cursor: pointer; float: left; margin: 15px 0; }
#sale_results .sale_content .ind a.view:hover { background: url(images/view_more.png) no-repeat; height: 39px; width: 265px; background-position: 0 -39px; }
-------------------
Previous Post Below
The PHP is getting the info fine from the database
but I cannot get the text to the right of
the image, it shows low diagonal right
below where it should be.
------------------
- pic text -
- left right -
------------------
- text
- showing
- here
Maybe someone with fresh eyes can see something i'm not
Try styling your image with float: left; and your text with float: right;
If you are talking about the image at the top, then a simple float: left; would do the trick.
So add a class to the image or its anchor, for example class="left":
echo "<a class="left" href='127.0.0.1/forsale/?sale=".$row['AGENT_REF']."'><img src='127.0.0.1/vebra/assets/".$row['MEDIA_IMAGE_02']."' width='296px'></a><br />"; // home image and link
And then float it in your css:
.left {
float: left;
}
Here a jsfiddle of what I imagine you are trying to accomplish.
try to remove float:left from this line:
#sale_results .sale_content ul#info li span { font-size: 14px; font-weight: bold; color: #3B3E40; line-height: 24px; float: left; }

css divs aren't floating in alignment

Hi i have coded my news content of my wordpress blog, i made the content float right and the date and comments float left of the conten, now it is floating perfectly except for one thing.
The date and comments for the first post is aligned but the date and comments for the second post is also aligned with the first post, when it should be aligned with the second post. and the date and comments under the second post is suppose to be for the third post, which leaves the last post without date time or comments. Example below.
here is my css
#content {
width: 1070px;
}
.right{
position:relative;
float:right;
right:215px;
}
.left{
position:relative;
float:left;
left:200px;
display:block;
}
.date{
width:80px;
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
clear:left;
}
.month {
color:#fff;
font-size:15px;
font-family:eurofurence;
text-transform:uppercase;
}
.year {
color:#fff;
padding:0 0 7px 0;
font-size:30px;
font-family:eurofurence;
text-transform:uppercase;
}
.commentbubble{
background: url('http://bleedartmedia.com/mock/wp-content/themes/KellyRowland/images/commentb.png') no-repeat;
width:40px;
height:49px;
padding:4px 0 0 14px;
}
.entry {
margin: 0px 0px 0px 0px;
padding: 0px 10px 0px 10px;
border-bottom: 0px solid #cccccc;
font-family:eurofurence;
font-size:17px;
width:610px;
background:#000;
}
.entry-top {
margin: 0 0 0px 0;
padding: 0 0 0px 0;
text-align: left;
}
.entry-top .entry-title {
color: #fff;
font-family:eurofurence light;
font-size:28px;
}
.entry-top .entry-author {
font-style: italic;
}
.entry-title {
margin: 0;
padding: 0;
font-size: 1.3em;
font-weight: bold;
line-height: normal;
font-stretch: narrower;
}
.entry-title a:link,
.entry-title a:visited {
color: #fff;
font-family:eurofurence light;
font-size:28px;
}
.entry-title a:hover {
color: #3E7AB9;
text-decoration: none;
}
.entry-content {
margin: 10px 0 10px 0;
padding: 0px 10px 10px 10px;
font-family:eurofurence;
font-size:17px;
}
and here is my coding
<div id="content">
<?php while ( have_posts() ) : the_post() ?>
<div class="date left">
<div class='month'><?php the_date('M');?></div>
<div class='year'><?php the_time('d');?></div>
<div class="commentbubble">
<?php comments_popup_link( __( '0', 'wpbx' ), __( '1', 'wpbx' ), __( '%', 'wpbx' ) ) ?>
</div>
Comments
</div>
<div class="entry right">
<div class="entry-top">
<h2 class="entry-title"><?php the_title() ?></h2>
</div>
<div class="entry-content clearfix">
<div class="entry-content">
<div id="text"><?php the_content() ?></div>
</div>
</div>
<div class="entry-meta">
</div>
</div><!-- .post -->
<br>
<?php endwhile; ?>
</div><!-- #content -->
Anyone have a solution
I'm guessing your php while loop starts outside of the shown html? What I would do here is make sure that you contain your date-left and entry-right in a single div, and use the php while to repeat the div. I think all you'll have to do is find where your while loop starts, add a div, and then right before it ends add a closing div.
<loop start>
<div>
....(divs containing entry and date here)
</div>
<loop end>
Try adding this to clear the float:
.date.left { clear: left; }