close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

css float problem

Thread began 11/23/2012 11:17 am by CraigR | Last modified 11/24/2012 10:44 am by CraigR | 1113 views | 8 replies |

CraigRBeta Tester

css float problem

i have a page of product categories, where each category image sits in a left floated div, so that i can fit 3 to a line, giving a grid like effect.

i want some text to sit beneath each set of images, which varies depending on the number of items in each category.

where i have 3, 6 or 9 images, no problem, the grid is filled, the text sits underneath, however if I have 4 or 7 images, the text sits alongside.

i have tried adding a clearboth break below the 'grid', but this forces the text to below the content of the left sidebar.

eg category.php?CategoryID=1

looks ok

category.php?CategoryID=14 has a big gap because of the sidebar.

Sign in to reply to this post

JamieEff

Have you tried wrapping the element above it in a div and then using clear:right; instead of both ?

Jamie

Sign in to reply to this post

CraigRBeta Tester

Hi Jamie.

Yeah, i tried that, i put all the repeating elements within their own div, tried clearing right only, even put the text in a div with a fixed width and it still won't behave itself

Sign in to reply to this post

MikeyT

I'm not sure if this is what you're tying to accomplish, but removing the { clear: left; } property on the id named #clearFloat removes the large gap.

Sign in to reply to this post

CraigRBeta Tester

thanks for looking Mikey.

It does,.. but if you do the same to the summerhouse page, (category1) the text sits alongside the image box, and i want it to sit beneath

Sign in to reply to this post

MikeyT

Gotcha. I see what you mean. Have you tried adding a class to the div that's wrapping the h1 and paragraph and { float: left;} the div?

Remove the { clear: left; } property on the id named #clearFloat then added a { float: left; } property to the div wrapping the h1 and paragraph. If you add a class to the h1 and { float: left; } as well, it starts to put the paragraph into position. Getting the paragraph to then cooperate and drop below the h1 is the next challenge.

Just tried it in Web Inspector and I think its starting to work. Sorry if my persistence becomes annoying.

Sign in to reply to this post

CraigRBeta Tester

getting there

Your persistence is gratefully received!

I removed the clear:left property and added a class to the div around the text.

floating left on its own doesn't quite do it, but setting a width moves it down as required.

only thing is, the paragraph text is cut off unless I also set a div height.

Don't know why that is , but its getting a lot closer.

Cheers

Sign in to reply to this post

MikeyT

Yes, that paragraph is being finicky! Best of luck finishing it up... glad to lend a hand.

Sign in to reply to this post

CraigRBeta Tester

cheers, much appreciated

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...