Home > Article > Web Front-end > What should I do if the css right attribute does not work?
css The right attribute does not work because the value of the position attribute of the element is static. The solution is to change the value of the position attribute of the element to any one of relative, absolute, and fixed.
#The operating environment of this tutorial: Windows 7 system, css3 version, Dell G3 computer.
Recommended: "css video tutorial"
Solution to the problem that the css right attribute does not take effect
The css right attribute does not take effect This is because the value of the position attribute of the element is static. The solution is to change the value of the position attribute of the element to any one of relative, absolute, and fixed.
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: If the value of the "position" attribute is "static", then setting the "right" attribute will have no effect.
Example:
img { position:absolute; right:5px; }
Sets the right edge of the image 5 pixels to the left of the right edge of its containing element.
The above is the detailed content of What should I do if the css right attribute does not work?. For more information, please follow other related articles on the PHP Chinese website!