How to define a measurement in screen pixels with CSS?



To define a measurement in screen pixels with CSS, use the px unit.

Let us see an example:

<html>
   <head>
   </head>
   <body>
      <div style = "position:relative;left:90px;top:3px;background-color:yellow;">
         This div has relative positioning.
      </div>
   </body>
</html>

Advertisements