Syntax error How to define a measurement in screen pixels with CSS?

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>
Updated on: 2020-01-30T07:27:48+05:30

184 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements