This is a discussion on "div align problem" within the Web Page Design section. This forum, and the thread "div align problem are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
div align problem
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
div align problem
Hi all,
I've got fixed width container and some fixed width id=cat divs in it. First 3 of them fit in one row horizontaly, others are shown in a next row leaving a vertical spaces on a page. I could split container into 3 parts, but I need to keep html simple as shown. Is there any CSS trick to force last 3 divs to stick to upper ones verticaly? Thanks in advance. Heres the code: HTML:
|
|
|
|
#2
|
|||
|
|||
|
Re: div align problem
<div id="cat"> is used 5 times. #cat should only be used once per page.
Try changing your #cat to .cat |
|
#3
|
|||
|
|||
|
Re: div align problem
Quote:
However, you can use a class, which can be used one or more times in a page. These are the ones in you CSS with the '.'. Hope this helps you understand. Ed.
Last Blog Entry: Happy New Year! (Dec 31st, 2007)
|
|
#4
|
|||
|
|||
|
Re: div align problem
Hi,
Thanks for your answers. Learned something new Anyway, that does not answer my question and does not change the layout in anyway. Here's how the code looks now: HTML:
|
|
#5
|
|||
|
|||
|
Re: div align problem
could you post a screenshot of what you have. and you're full code.
|
|
#6
|
|||
|
|||
|
Re: div align problem
Sure
I had to do that in a first place :P ![]() So I have these dynamicly generated boxes. I want to keep backend generated code simple so the frontend would be highly customizable with as less restrictions and rules as posible. In this case backend generates:
|
|
#7
|
|||
|
|||
|
Re: div align problem
Oh, full code:
|
|
#8
|
|||
|
|||
|
Re: div align problem
I have rewritten your code, color-coded the 3 columns for easier identification, you can undo that.
HTML
|
|
#9
|
|||
|
|||
|
Re: div align problem
Ok. Originaly I was asking is there any CCS trick to make it work *without* puting cat's into three containers. Hmm.. I asume not.
I rating myself as a guy who can write some raw HTML/CSS and make it work on Firefox, so your code above looks very strange to me. Why do you put two cols in a container which already is in a container? That doesnt look logical. Can't I just put all the cols in one container? Anyway, I've just googled this 'clearfix' and whanted to ask why is it better than 'overflow: auto;'. Doesn't that work on some browsers? Thanks. |
|
#10
|
|||
|
|||
|
Re: div align problem
Sorry, I read the "without 3 containers" but after a few tries must have pushed it out of my accessible memory.
If the problem is that you don't want the end user to get confused, why not put the 6 separate "CAT's" into 6 separate SSI files? Then your clients will not see any html at all. The 2 in 1 column is a spillover from making the center column the MAIN column, the left the navigation and the right the announcements/news column. Some search engines give higher scores to what is written first in the HTML. This way, one ensures the central column to be the first. As to the clearfix, I find that it works in all cases. Some time ago I had some problems with a browser called Konqueror and clearfix seemed to solve it. |
|
#11
|
|||
|
|||
|
Re: div align problem
Thank you for this valuable information.
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sifr Align Right | Salbert | Flash & Multimedia Forum | 8 | Apr 2nd, 2008 13:31 |
| verticle align image problem | heyo | Web Page Design | 2 | Jul 4th, 2007 18:22 |
| textformat.align problem | janper | Flash & Multimedia Forum | 1 | Apr 13th, 2007 21:57 |
| Trying to align a div in a wrapper | AdRock | Web Page Design | 7 | Feb 22nd, 2007 16:03 |
| Align problem | Amphersand | Web Page Design | 3 | Oct 11th, 2006 17:11 |