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 8224191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:58:36+00:00 2026-06-07T14:58:36+00:00

When a static block element follows a floated element it will fill the remaining

  • 0

When a static block element follows a floated element it will fill the remaining space available to it.

So, for example .right will take a width of 80%:

.left {
    background-color: red;
    float: left;
    width: 20%;    
}

.right {
    background-color: blue;
}

http://jsfiddle.net/yryZR/

However, when a block element with position: relative follows a floated element, the floated element seems to be ignored and the relative element takes 100% width:

.left {
    background-color: red;
    float: left;
    width: 20%;    
}

.right {
    background-color: blue;
    position: relative;
}

http://jsfiddle.net/yryZR/1/

According to the W3C “Once a box has been laid out according to the normal flow or floated, it may be shifted relative to this position” (source)

So if I am not changing the left or right positions of the element, why does it set itself to the very left of its parent element rather than stay in the normal flow?

  • 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-06-07T14:58:38+00:00Added an answer on June 7, 2026 at 2:58 pm

    position:relative refers to the position the element would’ve been in had there been no CSS positioning overrides – e.g. its natural unaltered position.

    floated elements are essentially removed from document positioning calculations, so your left element is invisible for the right element’s positioning, so it takes the size of the next higher element – the container that these two left/right boxes are in.

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

Sidebar

Related Questions

Are variables declared inside a static block accessible anywhere else? What kind of member
I have intialized Hash map inside static block, I need to access the hashmap
I have a class in which i have intialized hashmap in static block. Passing
I have a static initialization block where I read data from DB into certain
When i have a code block static void Main() { foreach (int i in
As far as I understood the static initialization block is used to set values
I want to give a static javascript block of code to a html template
I have stylesheet block in base layout: {% stylesheets filter='cssrewrite' 'bundles/static/css/main.css' %} <link rel=stylesheet
The simple code block below can be served up in a static HTML page
Hi I have following code block public class Driver { static String x =

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.