CSS Bottom



CSS Tutorial  >  Position  >  Bottom

The bottom property specifies the distance from the bottom of the element to the default location of the element (when position=relative) or the distance between the bottom of the element to the bottom of the container (position=absolute). This can be specified as a percentage, as a length, or 'auto'.

Let's take a look the following example:

CSS Code

div {
  background-color:#FF00FF;
  width:250px;
  height:60px;
}

p {
}
 
 

The HTML code,

<div>
  <p>No bottom property.
</div>

renders

No bottom property.

div {
  background-color:#FF00FF;
  width:250px;
  height:60px;
}

p {
  position:relative;
  bottom:5px;
}

 

<div>
  <p>Apply bottom:5px.
</div>

 

Apply bottom:5px.

In the above example, applying the {position:relative; bottom:5px;} style moved the text up by 5px.

Next: CSS Left




Copyright © 2024   1keydata.com   All Rights Reserved   Privacy Policy   About   Contact

AdBlock Detected!

Our website is made possible by displaying ads to our visitors. Please supporting us by whitelisting our website.