Should I have mentioned that all of this code is inside a wrapper div too? will that affect my ability to float these three.
Hi,
We would really need to see your complete code to suggest the best way to approach it. Floats are removed from the normal page flow so there will be an effect on other elements around them. The first block element that follows the floats may need to be cleared.
If you have a link to your page go ahead and post it.
if I do this, everything appears in the correct order (movie name, movie release date, movie genre):
but the #wishlistgenre div appears too low for some reason, like this
You either need to float all three of the divs or bring the floats first in the source order. Floats cannot rise above a block element that comes before it in the source.
Also depends on whether or not your page is a fixed or fluid width as to how you need to set up the floats.
Something like this would work for fluid widths but the floats are coming first. There are some other ways to do it though they can get complicated.
I have not catered to IE6 in this example, it would need some help with “haslayout” and the 3px jog.
Here’s another version of a fluid width layout that floats all three columns.
The main content comes before the right column in the markup in this version but it gets a little trickier with negative margins making it all snap into place.
You can bypass the IE6 3px jog I mentioned by floating them all.
If your page is a fixed width then you can just set the column widths and float them all left.
sorry, been out all day - my site is local only but I will post some more detailed code, edited a bit to save space:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>movies</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link href="style1.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="wrapper">
*****user navigation goes here*****
<div id="main">
<div id="moviecollection">
<?php
include 'moviecollection.php';
if ($wishlist == '1')
{
*****some code here to gather movies*****
while ($row = mysqli_fetch_assoc($wishlist)) {
echo '<div id="wishlistwrap">';
echo '<div id="wishlistmovie">';
echo $row["moviename"];
echo '</div>';
echo '<div id="wishlistreleasedate">';
echo $row["wishlistreleasedate"];
echo '</div>';
echo '<div id="wishlistgenre">';
echo $row["genre_abbreviation"];
echo '</div>';
echo '</div>'; // end of wishlistwrap div
}
echo '<br/>';
}
****output of complete list of movies here (those not in wishlist above)****
</div> <!-- end of main div -->
</div> <!-- end of wrapper div -->
</body>
</html>