Posts

Showing posts from May, 2021

Tóm tắt cú pháp CSS

Image
Mục đích của việc tóm tắt này là để ĐỌC HIỂU các tập tin CSS mỗi khi bắt gặp chúng trong quá trình phân tích các trang web. Cú pháp chung A. CSS Selectors 1. Element selector The element selector selects HTML elements based on the element name. Example Here, all <p> elements on the page will be center-aligned, with a red text color:  p  {   text-align :  center ;   color :  red ; } 2. ID selector The id selector uses the id attribute of an HTML element to select a specific element. The id of an element is unique within a page, so the id selector is used to select one unique element! To select an element with a specific id, write a hash (#) character, followed by the id of the element. Example The CSS rule below will be applied to the HTML element with id="para1":  #para1  {   text-align :  center ;   color :  red ; } 3. Class selector The class selector selects HTML elements with a specific class attribute. To select elements with a specific class, write a period (.) ch