go to  ForumEasy.com   
CSS + jQuery
Home » Archive » Message


[Email To Friend][View in Live Context][prev topic « prev post | next post » next topic]
  CSS Position: Fixed
 
Subject: CSS Position: Fixed
Author: CyberSpider
In response to: CSS Position: Absolute
Posted on: 04/17/2016 05:31:48 PM

Let's further change the value to fixed

#box3 {
        background-color: blue;
        position: fixed;
        bottom: 30px;
        right: 0px;
    }

Try it yourself in sandbox »

The blue box has been taken away from the normal flow as if it were not there (not even the occupied space). It is now placed at 30px from bottom and 0px from right, fixedly attached to the view screen regardless of the document or its parent container.


 

> On 04/17/2016 04:38:52 PM CyberSpider wrote:

Now let's change relative to absolute
    #box3 {
        background-color: blue;
        position: absolute;
        top: 30px;
        left: 20px;
    }

Try it yourself in sandbox »

The blue box has been taken away from the normal flow as if it were not there (not even the occupied space). It is now placed at 30px from top and 20px from left, absolutely from the root document or its parent container (the parent container must declare as position:relative).





References:

 


 
Powered by ForumEasy © 2002-2022, All Rights Reserved. | Privacy Policy | Terms of Use
 
Get your own forum today. It's easy and free.