Forum Moderators: not2easy

Message Too Old, No Replies

Floating / Margin Question

         

unremarkable

10:21 am on Jan 26, 2006 (gmt 0)

10+ Year Member



Okay...suppose I have ten images, floated next to each other, and underneath, I want a header, and I want the header to have a 1em margin above it, between it and the images. How do I achieve this?

Everything I've tried, with margin and padding on both elements, fails, presumably because the floated elements are removed from the normal flow of the document?

But even if the images are enclosed in a div, and that's not floated, I can still not get a 1em margin underneath. What am I missing?

Thanks in advance!

un

Span

10:36 am on Jan 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Everything I've tried

Well that's it then. Not possible. Welcome to the forums, unremarkable.

Have tried 'clearing' your floating images?


<img ... />
...
<img ... /><br class="clear" />
<h1>Header</h1>


br.clear {
clear:both;
}
h1 {
margin:1em;
}

unremarkable

10:49 am on Jan 26, 2006 (gmt 0)

10+ Year Member



Ah, cheers, but I want clean code, and putting a non-semantic <br> in there offends my delicate sensibilities. ;)

But I did try clear:both; in the CSS of both the img div and the header, and they didn't help...

unremarkable

11:17 am on Jan 26, 2006 (gmt 0)

10+ Year Member



Ah! I did it!

The old overflow:auto; applied to the photo-enclosing div did it...

...that's detailed here:

[snip]

:)

[edited by: createErrorMsg at 1:21 pm (utc) on Jan. 26, 2006]
[edit reason] Sorry, no blog links. [/edit]

Span

12:05 pm on Jan 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't know what to say, unremarkable. You just made the post of the month.

unremarkable

10:28 am on Jan 27, 2006 (gmt 0)

10+ Year Member



Well, thank you. Not bad for a newbie, eh? ;)

Although I'm probably not going to hang around, not after my post was censored. I'm into, like sharing information, learning together, growing, kinda thing, so will go sign up somewhere where they encourage free exchange of information.

I shall forever be known as The guy who came, made the post of the month, then disappeared as quickly as he arrived...the legend will be embellished over generations, to include my riding a black horse and wearing a mask, and books will be written theorising on my true identity ("...many thought he might have been Jeffrey Zeldman...")...

...adios!

jetboy

10:38 am on Jan 27, 2006 (gmt 0)

10+ Year Member



many thought he might have been Jeffrey Zeldman

While others have claimed that this is unlikely, given that Zeldman wasn't famed for his horse-riding abilities, but did know how to clear floats. ;)

Adios, masked fighter of URL censorship!