Click here to navigate the course.

Drag the edges to resize the window.

In Projects, you can keep track of your progress as you go throught the tasks. Check each item as you complete it!

Code Editor
Web Browser
Learn

One way to modify the default position of an element is by setting its position property to relative.

This value allows you to position an element relative to its default position the web page.

div.description { background-color: #1D09AF; width: 50px; height: 50px; position: relative; }

Although the code in the example above instructs the browser to expect a relative positioning of the div, it does not specify exactly where the div should be positioned on the page.

div.description { background-color: #1D09AF; width: 50px; height: 50px; position: relative; top: 50px; left: 75px; }

In the example above, the div has been positioned using two of the four offset properties. The valid offset properties are:

  1. top - moves the element down.
  2. bottom - moves the element up.
  3. left - moves the element right.
  4. right - moves the element left.

In the example above, the div will be moved down 50 pixels and to the right 75 pixels. Units for offset properties can be specified pixels, ems, or percentages. Note that offset properties will not work if the position of the element is not set to relative.

Report a Bug
If you see a bug or any other issue with this page, please report it here.