Div trouble

Programming, for all ages and all languages.
Post Reply
Kon-Tiki

Div trouble

Post by Kon-Tiki »

I've got two divs inside a bigger div. One of the divs should go to the left end of the bigger div, while the other one should go to the right, on the same height as the first one. Closest I seem to get, is with the second one a line lower than the first one. Anybody here know how to solve this?
YeXo

Re:Div trouble

Post by YeXo »

Can you post your relevant css code?

Can't you just give the left div style="float:left;" and the right div style="float:right;"?
Kon-Tiki

Re:Div trouble

Post by Kon-Tiki »

Yep, fixed it a few hours after posting this, using float: right; on the quick search box. Still'm having some misbehaviour from IE on display: block; elements, changing those blocks' size according to the contents, instead of keeping it to the width and height as defined in the CSS.
YeXo

Re:Div trouble

Post by YeXo »

Yeah, it's known that ie renders the box model bad in most cases. Google for ie box model, first result (which explains it very well):http://css.maxdesign.com.au/listamatic/about-boxmodel.htm, or use this one (Dutch): http://www.gigadesign.be/2004/12/css-box-model-hack/
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Div trouble

Post by Solar »

Hmmm... HTML in "General Programming"? ??? 8)
Every good solution is obvious once you've found it.
Kon-Tiki

Re:Div trouble

Post by Kon-Tiki »

;D It's the only place it'd fit, even if it's technically not programming ;)
Kon-Tiki

Re:Div trouble

Post by Kon-Tiki »

YeXo, I think I didn't explain the problem right. I already know how to fix that box problem (sure was a hemorrhoid to do so ::)) I'll link you, so you can see what the problem is.
Check the bottom of the first page, and especially the second page. It'll show just fine in Firefox, but if you check it in IE, it'll be all messed up, with a different size for each thumbnail box, size differing from the thumbnail's size.
YeXo

Re:Div trouble

Post by YeXo »

I see your problem now. The second line in this code:

Code: Select all

div.thumb {
  margin-left, margin-right: 3px;
  padding: 5px;
  border: 1px solid #222222;
  width: 120px;
  height: 135px;
  display: block;
  float: left;
}
is not vallid according to w3.org. Although this shouldn't break your layout like this, I have no idea what else can be the fault.
mystran

Re:Div trouble

Post by mystran »

Solar wrote: Hmmm... HTML in "General Programming"? ??? 8)
Why not? These days you often need to know HTML when doing general programming, because general programming often has a presentation layer that pukes HTML.

%)
Kon-Tiki

Re:Div trouble

Post by Kon-Tiki »

Hmm, that line's redundant. I don't even want any margin there. Tossed it out, and the problem's still there.
Post Reply