Solved

Line up divs How do I do it?

Posted on 2007-03-19
2
840 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

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.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

733 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