!important ต่อท้าย เช่น
css ตัวเก่า จะทำให้ตัวมันลบทุกสิทธิ์
div.contenedor{
margin:15px !important;
width:145px !important;
height:145px;
background-color: #233c80;
overflow: hidden;
}css ตัวใหม่
div.contenedor{
margin:15px;
width:145px;
height:145px;
background-color: #233c80;
overflow: hidden;
}
css ตัวเก่าส่วน margin:15px !important; width:145px !important; ก็จะแสดงผลโดยไม่สนใจ css ตัวใหม่
CSS Selector มากมาย ปัญหาที่น่าจะเจอกันบ่อย ๆ คือ CSS เขียนแล้วไม่ยอมทำงาน เพราะโดน Selector ตัวอื่นเขียนทับ ต้องใส่ !important
แต่ยิ่งเราเขียนโค้ดเยอะ ๆ ก็จะพบว่าการใส่ !important จะทำให้มีปัญหาตีกับ Element อื่นอีกในเวลาต่อมา โค้ดดูแลยากในระยะยาว