PDA

View Full Version : Resolved How to horizontally align?



Dan06
Apr 20th, 2009, 06:24 PM
I want to align images in a straight line horizontally. I floated the images, thus creating a line, but since the images are floated the images that cannot fit on the first line move down to the second. I don't want the images to move down - I want them to stay on the same line and be hidden (I was thinking via overflow: hidden). Anyone know how I can align the images in a straight line without having images move to the next line if they cannot fit?

Thanks.

BoldUlysses
Apr 20th, 2009, 06:53 PM
Your code or a link to your page (preferable) would be really helpful. Chances are it's pretty easy to sort out.

Dan06
Apr 20th, 2009, 07:24 PM
Your code or a link to your page (preferable) would be really helpful. Chances are it's pretty easy to sort out.

I've attached the html; hopefully, it will be easy to sort out. Thanks.

sphinx1994
Apr 20th, 2009, 07:35 PM
<BR> tag

BoldUlysses
Apr 20th, 2009, 07:52 PM
<BR> tag

Do you even read the original post?

Re: the solution, give the nested <ul> an arbitrarily large width, e.g.:


.gallery{
list-style: none;
width:2000px;
}


p.s. -- Next time, please don't attach your code, post it instead in &#91;CODE&#93;&#91;/CODE&#93; tags.

Dan06
Apr 20th, 2009, 08:13 PM
Re: the solution, give the nested <ul> an arbitrarily large width, e.g.:


.gallery{
list-style: none;
width:2000px;
}


p.s. -- Next time, please don't attach your code, post it instead in
tags.

@msuffern:
You were absolutely right, that was pretty easy to sort out. Just to make sure that I understand the solution: setting the ul width to 2000px, allows the li elements to fit on one line rather their normal sequential structure?

I didn't have a link to provide to the page, so I thought the next best thing would be to attach the page; but if the preferable alternative is to the post the code, I will certainly do that.

Thanks for the help.

sphinx1994
Apr 20th, 2009, 08:24 PM
isn't horizontally down? if not my mistake, calm down please.

BoldUlysses
Apr 20th, 2009, 08:27 PM
Just to make sure that I understand the solution: setting the ul width to 2000px, allows the li elements to fit on one line rather their normal sequential structure?

The width was just an arbitrary number I chose that was wider than the containing div. Think about how the elements are nested: You have a containing div with set dimensions (175px by something or other) with overflow set to hidden, so it functions as a kind of a "window" on the unordered list inside it, which is given a large width so that the contents don't wrap. I dunno if that clears it up any; I just wanted to clarify that 2000px isn't the "magic number" or anything.


if the preferable alternative is to the post the code, I will certainly do that.

It is. :D

Dan06
Apr 20th, 2009, 10:26 PM
Think about how the elements are nested: You have a containing div with set dimensions (175px by something or other) with overflow set to hidden, so it functions as a kind of a "window" on the unordered list inside it, which is given a large width so that the contents don't wrap.

I was unsure how giving the ul a large, arbitrary width solved the problem. Your explanation completely answered my question.

Thanks,
Dan