Solved

Line up divs How do I do it?

Posted on 2007-03-19
2
833 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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
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 embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…

777 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