Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7660631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:29:31+00:00 2026-05-31T13:29:31+00:00

When an element is floated, how do different display properties affect the layout? Or,

  • 0

When an element is floated, how do different display properties affect the layout? Or, what are the differences, if any, between these classes:

div.foo {
    display: block;
    float: left;
}

div.foo2 {
    display: inline;
    float: left;
}

div.foo3 {
    display: inline-block;
    float: left;
}

EDIT:

If there are no differences according to the spec, then do certain antiquated versions of browsers (ahem, IE) render them differently?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:29:32+00:00Added an answer on May 31, 2026 at 1:29 pm

    If I read the spec correctly, and practice confirms this, setting float: left or right overrides the display property anyway and forces display: block on the element (although with peculiarities, see below), so there will no difference between your three examples:

    left
    The element generates a block box that is floated to the left. Content flows on the right side of the box, starting at the top (subject to the ‘clear’ property).

    right
    Similar to ‘left’, except the box is floated to the right, and content flows on the left side of the box, starting at the top.

    none
    The box is not floated.

    Differently from normal display: block though, setting float dictates its own behaviour in regards to width that override the display property: if no width was explicitly specified, the floated element will take up as much width as it needs, as opposed to standard block element behaviour of taking up 100% width automatically.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in between lots of floated elements if we give position:relative to any element to
I was wondering what the best element for clearing floated block-level elements would be?
Quick question! Does putting a clear element INSIDE a floated div do anything? Like:
If there are floated elements in a parent element, they parent element looses its
I'd like to apply absolute position inside the a div that's floated to the
Anyone know why overflow:hidden forces an element with floated elements to wrap the elements?
How to vertically center a child element of arbitrary size inside a floated parent
I have an element in a div set to float: right however, it causes
There are 5 floated div s which heights are stretched to 100% of document
I have this: http://jsfiddle.net/ETm93/ Now my floated element, leftPanel is having a margin-right: 20px;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.