Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Relative Position Property


Relative Position Property

The relative value of the position property specifies how the element will be positions relative to how it would have been positioned by default. 
It is used in combination with a direction (top, bottom, left, and right).
Let's view an example of relative position in action:

CSS Code

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

p {
}
 


The HTML code,

<div>
  <p>Example to show relative position.
</div>

The Output is as follow:
Type the above code and see the output (Default Position).


Example2

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

p {
  position:relative;
  top:15px;
}
<div>
  <p>Example to show relative position.
</div>

The Output is as follow:
Type the above code and see the output (Using Relative Position Property).




This post first appeared on Web Designing With Internet Marketing And Social M, please read the originial post: here

Share the post

Relative Position Property

×

Subscribe to Web Designing With Internet Marketing And Social M

Get updates delivered right to your inbox!

Thank you for your subscription

×