Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-13-2006, 10:50 PM   PM User | #1
petraska
New to the CF scene

 
Join Date: Dec 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
petraska is an unknown quantity at this point
Need help with div rows

Hello all,

I am having an issue with html. This might be a design issue or a technical issue I am not sure yet. What I have is a row of div tags that are generated in php with a for loop and. Each <div> tag contains an <img> tag and a <label> tag. All the <div> tags have the same id.

When the page loads it will load the <div> tags in a vertical line. The best i can do is make this a list and display it inline, but then I get a horizontal line with no wrapping.

Ultimately, what I want is rows of pictures with a label under them that will autowrap when the browser is re-sized. Nothing more, nothing less. Let's assume that I have no css and here is basic structure for the repeating div tags:

<div class="item_picmenu_item" id="item_picmenu_item">
<img src="somepic.jpg"><br>
<label>Some label</label>
</div>

Thanks in advance
petraska is offline   Reply With Quote
Old 12-13-2006, 11:46 PM   PM User | #2
oracleguy
Rockstar Coder


 
Join Date: Jun 2002
Location: USA
Posts: 9,043
Thanks: 1
Thanked 322 Times in 318 Posts
oracleguy is a jewel in the roughoracleguy is a jewel in the roughoracleguy is a jewel in the rough
Well you can lose the id attribute on the div unless each div has a different ID value.

You can achieve the affect you are going for by floating the divs. e.g.

Code:
.item_picmenu_item
{
float: left;
}
And that should cause them to auto-wrap depending on the browser width.

Some thing very similar to what you are implementing is discussed in this article: http://www.alistapart.com/articles/practicalcss/
__________________
OracleGuy
oracleguy is offline   Reply With Quote
Old 12-13-2006, 11:51 PM   PM User | #3
petraska
New to the CF scene

 
Join Date: Dec 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
petraska is an unknown quantity at this point
Oh it was so simple it makes me want to cry.
petraska is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:14 AM.


Advertisement
Log in to turn off these ads.