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

กำหนดความกว้างของ Box ด้วย CSS

คุณสมบัติ width ใช้กำหนดความกว้างของ Box รับค่าเป็นความยาว, เปอร์เซ็นต์, หรือคีย์เวิร์ด auto

ตัวอย่าง

<html>
<head></head>
<body>
    <p style="width:200px; height:50px; border:2px solid green; padding:15px; margin:20px;">
        This paragraph is 200pixels wide and 50 pixels high
    </p>
</body>
</html>