Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Mastering Floats

Featured Replies

if I had a weak point in my overall css knowledge Id have to admit it was floats has anyone got any recommendations how I can master this particular facet of web design? ie stuff that worked for you :)

 

Any help appreciated

 

Pottsy

Just remember to clear them when you need to

There are three basic situations with floats:-

1. Where you just want to float an element inside another and have text wrap around the floated element

See item 2 here http://www.wickham43.net/divboxes.php

2. Several floated elements side by side

See item 3 here http://www.wickham43.net/divboxes.php

3. One or more floated elements inside a container and you want the container background to cover the floated element(s).

See examples of background situations here http://www.wickham43...xbackground.php Item 2d is a favorite method of clearing floats to make the background show down to the bottom of the floated divs and to stop the following element from showing too high up (floated elements don't give their height to the container so the following element will appear too high unless you clear the floats).

Edited by Wickham

How do you get on in life without clearing floats?

 

With floats I find you just have to understand exactly how they work/what they do rather than just seeing the effect making an element float has. That way you can use them more efficiently.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.