Solved

Line up divs How do I do it?

Posted on 2007-03-19
2
831 Views
Last Modified: 2013-11-19
I am trying to get multiple divs with an image in each of them to line up from left to right all within a Div container.

It works great when I do it like this without each image in a div like this
css is this
.thumbgrid {
      width: 840px;
      height: 74px;
      overflow: hidden;
      margin: 0;
      text-align: center;
      font-size: 0;
      line-height: 1px;
      }

<div class="thumbgrid" style="z-index: 101; left: 0; width: 840px; position: static;
           top: 92px; height: 77px">
           
<a href="#" class="imagehover"><img src="someimage1.jpg" border="0" title="Artist 1" style="width: 53px; height: 74px;" /></a>

<a href="#" class="imagehover"><img src="someimage2.jpg" width="46" height="74" border="0" title="Artist 2" /></a>
/*-- I have around 15 images that will span accross the top and if I do them like what you see above it
works just fine but .... its not what I need. --*/
</div>

The above images will line up and if I go over 15 images it will start a new row and so on ...

Ok No what I need to is to able to make the divs with images do the same   this is what I got how can I make this happen or can I make it happen?
\Here is my example


<div class="thumbgrid" style="z-index: 105; left: 0px; position: absolute; top: 108px">
  <div class"group1">
       <a href="#" class="imagehover"><img src="someimage1.jpg" border="0" title="Artist 1" style="width: 53px; height: 74px;" /></a>
  </div>

<div class"group1">
       <a href="#" class="imagehover"><img src="someimage2.jpg" border="0" title="Artist 2" style="width: 53px; height: 74px;" /></a>
  </div>
</div>


The above wont do what the other does but I needed it to because the script I have puts the images in side of divs so it can manipulate the group

I am wanting them to line up next to each other like this

-------- --------
|         | |          |
|         | |          |< -------- 15 accross
"""""""  """"""""
at the moment they are doing this

--------
|         |
|         |          
"""""""  
--------
|         |
|         |          
"""""""
--------
|         |
|         |          
"""""""
ect ect ect    So what am I missing that will get them to do what I need or as I said can it be done?

Mark
0
Comment
Question by:vbMarkO
2 Comments
 
LVL 30

Accepted Solution

by:
VirusMinus earned 500 total points
ID: 18752726
div's are block elements. they will create a new line, unless you instruct them not to.

add this to your CSS:

.thumbgrid .group1{float:left;} /*preferably also give the div a width*/
0
 

Author Comment

by:vbMarkO
ID: 18752780
VirusMinus

Awesome worked like ca Charm ... I have been pulling my hair out on this and I don't have enough to keep that up for long.

So thank you just what I needed!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now