Old 11-08-2007, 15:59   #1 (permalink)
devGOD
Registered User
 
Join Date: Sep 2005
Posts: 57
layout assistance needed

I need some assistance with converting this table setup into a div,ul/li setup.

I know how to use ul and li to set four boxs and float it right for one row but how do i do multiple rows, do i just repeat the same ul/li float right and for the top bar how do i float text on the left and right?

if someone can put together a quick example.

thanks in advance

Last edited by devGOD : 11-08-2007 at 16:24.
  Reply With Quote
Old 11-08-2007, 17:15   #2 (permalink)
2Dfruit
Biscuit
 
2Dfruit's Avatar
 
Join Date: Jun 2006
Location: Ireland
Posts: 976
I personally wouldn't use a list for that. I'd create a div class with the info for one box and put it inside a container that'd allow it to loop nicely ie 200px div in a 800px box..float the div left.

I did something similar here Smyth Property - Luxury Villas and Apartments in Turkey

feel free to use the code
__________________
"Get out of my face!"
"NO! I'll get in your FACE!"
  Reply With Quote
Old 12-08-2007, 05:30   #3 (permalink)
iWonder
Registered User
 
iWonder's Avatar
 
Join Date: Sep 2005
Posts: 56
Send a message via Yahoo to iWonder Send a message via Skype™ to iWonder
Try this

Code:
ul.mainbox { list-style: none; border: 1px solid #ccc; } ul.mainbox li{ width: 140px; padding: 10px; margin: 5px; float: left; background-color: #eee; } .clear { clear: both; }

HTML Code:
<ul class="mainbox"> <li> <img src="http://www.designerstalk.com/forums/image.php?u=4088&dateline=1186680767" alt="Image" /><br />Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</li> <li> <img src="http://www.designerstalk.com/forums/image.php?u=4088&dateline=1186680767" alt="Image" /><br />Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</li> <li> <img src="http://www.designerstalk.com/forums/image.php?u=4088&dateline=1186680767" alt="Image" /><br />Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</li> <li> <img src="http://www.designerstalk.com/forums/image.php?u=4088&dateline=1186680767" alt="Image" /><br />Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</li> <li> <img src="http://www.designerstalk.com/forums/image.php?u=4088&dateline=1186680767" alt="Image" /><br />Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</li> <li> <img src="http://www.designerstalk.com/forums/image.php?u=4088&dateline=1186680767" alt="Image" /><br />Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</li> <li> <img src="http://www.designerstalk.com/forums/image.php?u=4088&dateline=1186680767" alt="Image" /><br />Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</li> <li> <img src="http://www.designerstalk.com/forums/image.php?u=4088&dateline=1186680767" alt="Image" /><br />Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</li> <div class="clear"></div> </ul>
  Reply With Quote
Old 12-08-2007, 09:02   #4 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,340
Don't use a <br /> if you can help it.

Don't use a clearing element if you can help it. Especially when you're putting a <div> directly inside a <ul>. I'm 95% sure that's invalid HTML.

I would do each one as a unique box, defined by a <div> like 2Dfruit suggests.
  Reply With Quote
Old 12-08-2007, 18:51   #5 (permalink)
devGOD
Registered User
 
Join Date: Sep 2005
Posts: 57
how do i prevent the new boxes from making the footer move to the right? it loads fine at the bottom in IE but FF is moving the footer when i add the boxes
  Reply With Quote
Old 12-08-2007, 21:21   #6 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,340
You need to clear them. There are 3 ways to do this:

1. Use a clearing element like iWonder suggested (though his example is invalid).

2. Float the parent. Floats containing floats will automatically clear.

3. Use the method I prefer - the "clearfix" method. Excellent discussion in the article New clearing method needed for IE7?

I ignore the added lines for IE/Mac because I don't bother supporting IE/Mac on any of my sites.

Here's what I do currently:

In main stylesheet:

Code:
.clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
That provides clearing for all good browsers - Firefox, Safari, Opera, etc.

Then in my IE-only stylesheet:

Code:
.clearfix { height: 1%; }
  Reply With Quote
Old 12-08-2007, 22:49   #7 (permalink)
devGOD
Registered User
 
Join Date: Sep 2005
Posts: 57
Quote:
Originally Posted by pgo
You need to clear them. There are 3 ways to do this:

1. Use a clearing element like iWonder suggested (though his example is invalid).

2. Float the parent. Floats containing floats will automatically clear.

3. Use the method I prefer - the "clearfix" method. Excellent discussion in the article New clearing method needed for IE7?

I ignore the added lines for IE/Mac because I don't bother supporting IE/Mac on any of my sites.

Here's what I do currently:

In main stylesheet:

Code:
.clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
That provides clearing for all good browsers - Firefox, Safari, Opera, etc.

Then in my IE-only stylesheet:

Code:
.clearfix { height: 1%; }


thanks pgo... amazing that fixed it =)
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8