Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Line up divs How do I do it?

Posted on 2007-03-19
2
Medium Priority
?
851 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 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

721 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