Computer >> คอมพิวเตอร์ >  >> การเขียนโปรแกรม >> CSS

การใช้คุณสมบัติ Margin-right ด้วย CSS


ระยะขอบขวา ระบุระยะขอบด้านขวาขององค์ประกอบ สามารถมีค่าความยาว % หรืออัตโนมัติ คุณสามารถลองใช้รหัสต่อไปนี้เพื่อกำหนดระยะขอบด้านขวา -

ตัวอย่าง

<html>
   <head>
   </head>
   <body>
      <p style = "margin-right: 10px; border:2px solid red;">
         This is a paragraph with a specified right margin
      </p>
      <p style = "margin-right: 10%; border:2px solid green;">
         This is another paragraph with a specified right margin in percent
      </p>
   </body>
</html>