css The right attribute specifies the right edge of the element. This attribute defines the offset between the right margin boundary of the positioned element and the right boundary of its containing block.
#How to use the css right attribute?
Function: The right attribute specifies the right edge of the element. This property defines the offset between the right margin edge of the positioned element and the right edge of its containing block.
Note:
For static elements, it is auto;
For length values, it is the corresponding absolute length;
For percentage values, the specified value; otherwise, auto.
For relatively defined elements, the calculated value of left is always equal to right.
Note: All major browsers support the right attribute. The attribute value "inherit" is not supported in any version of Internet Explorer (including IE8).
css right attribute usage example
<html> <head> <style type="text/css"> img { position:absolute; right:50px; } </style> </head> <body> <h1>This is a heading</h1> <img src="https://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg" / alt="How to use css right attribute" > </body> </html>
Effect output:
The above is the detailed content of How to use css right attribute. For more information, please follow other related articles on the PHP Chinese website!