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.

Strange Float question

Featured Replies

Hi All

 

I'll like your views on what, if any, the practice of floating all divs and spans left by default, would have with regards to browser compatibility?

 

A colleague claims its the way forward but I'm not convinced, what do you think?

 

Mike

I have seen web page code where every div has had float: left; but I'm not sure that it helps at all.

 

It's extra code which in most cases doesn't do any harm. but most website coders don't bother; you should be able to code for all major browsers without adding it everywhere.

 

A block element like a div or p tag will automatically go to the left of a line below unless it has a float and the previous element also has a float.

 

A span tag is not a block element unless you make it block; span tags are designed to be used in the middle of some other inline element like text.

hmm, not sure about floating everything, suppose it wouldn't hurt, tho I'm not sure how IE6 would cope

 

if you want things to stack properly you can use clear:left; as well

  • Author

I have seen web page code where every div has had float: left; but I'm not sure that it helps at all.

 

It's extra code which in most cases doesn't do any harm. but most website coders don't bother; you should be able to code for all major browsers without adding it everywhere.

 

A block element like a div or p tag will automatically go to the left of a line below unless it has a float and the previous element also has a float.

 

A span tag is not a block element unless you make it block; span tags are designed to be used in the middle of some other inline element like text.

 

Do you think it go against w3c standards?

 

Mike

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.