![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
* I think floats were thought of with images in mind, see Jonathans take on that. We tend to use them for block level items like columns, and invariably those block level items are inside other containers that we don't want collapsed. That's where the tricks come in to give that container some height. * *I think it's that floats can do a lot of things you can't do well otherwise, so they get used for things that probably weren't conceived of. I'm using inline blocks for many things I used to use floats for, just to take a load off of the poor overused float. * *By the time CSS5 is widely implemented, we all should either be very happy, or dead. * *Jeff Thanks. It seems that there should be a simpler way of obtaining |
#12
| |||
| |||
|
|
On 5 June, 15:50, Helpful person <rrl... (AT) yahoo (DOT) com> wrote: As a beginner I have a simple question (the question is simple) about floats. *It seems to me that it is very difficult to get them to work as expected. * Read a _good_ tutorialhttp://brainjar.com/css/positioning/ |
#13
| |||
| |||
|
|
It's very easy to get them to work as they're supposed to. Perhaps the problem is your expectations? sherm-- Maybe. However it's not unreasonable to expect a structured language |
#14
| |||
| |||
|
|
On Jun 6, 6:42*am, Andy Dingley <ding... (AT) codesmiths (DOT) com> wrote: On 5 June, 15:50, Helpful person <rrl... (AT) yahoo (DOT) com> wrote: As a beginner I have a simple question (the question is simple) about floats. *It seems to me that it is very difficult to get them to work as expected. * Read a _good_ tutorialhttp://brainjar.com/css/positioning/ I have read a good tutorial. That doesn't make the method more sensible. How about something that is not a tutorial but musings which helped me |
#15
| |||
| |||
|
|
Because by default floats are *not* contained by their parent blocks in normal flow. What does that mean? Well if you have 2 paragraph blocks and within the 1st you have an image that you float. If the image is taller than the parent paragraph is *should* "break out" of the bottom of its parent and displace the contents of the 2nd. +-----------------+ | * paragraph 1 * | | * * * * * * * * | | * * * * * * * * | +--------+ * * * *| | float *|--------+ | image *|--------+ +--------+ * * * *| | * * * * * * * * | | * paragraph 2 * | +-----------------+ Just as you see in print like magazines. Now if you add a clearing element after the image it changes the flow so that paragraph 1 expands to fully contain the image. This works with IE6 +-----------------+ | * paragraph 1 * | | * * * * * * * * | | * * * * * * * * | +--------+ * * * *| | float *| * * * *| | image *| * * * *| +--------+ * * * *| +-----------------+ +-----------------+ | * paragraph 2 * | | * * * * * * * * | +-----------------+ Now there is an obscure feature that if you change the block formating context of the container that you can get it to "expand" contain the float. Setting its overflow property to something other than the default "visible" http://www.w3.org/TR/CSS21/visuren.html#block-formatting So setting paragraph 1 *'overflow: hidden' should make it expand to encompass the float. It does, but not in IE6. -- Take care, Jonathan ------------------- LITTLE WORKS STUDIOhttp://www.LittleWorksStudio.com |
![]() |
| Thread Tools | |
| Display Modes | |
| |