tailieunhanh - HTML Utopia: Designing Without Tables Using CSS- P2

HTML Utopia: Designing Without Tables Using CSS- P2: I’ve been around the Web for a while now some might say I’ve been here from the beginning. And one thing that always bothered me about the Web was its inherent inability to disentangle content from presentation. | Parts of a CSS Rule Figure . The parts of a CSS rule Selector p font -weight bold Declaration color blue ll _JL_ Property Value Each rule has two parts 1. a selector that defines the HTML element s to which the rule applies 2. a collection of one or more declarations made up of a property and a value 3 which describe the appearance of all the elements that match the selector The property tells the browser which element is being defined. For example font-weight tells the browser that this declaration defines the weight of the font. After the colon that separates the two parts of a declaration we see a value that will be applied to that property. If a value of bold followed the font-weight property it would make the weight of the font in that document bold. Each declaration must be followed by a semicolon with one exception the semicolon that follows the last property is optional and may be omitted. In this book though we ll always add the optional semicolon. I encourage you to adopt this habit as it s much easier to train yourself always to add the semicolon than it is to remember when it is and is not required. This approach also makes it easier to add properties to an existing style rule. Here are a few examples of increasingly complex CSS rules with the parts identified so that you can fix this syntax clearly in your mind. This is the only real syntax issue you must understand in order to master CSS so it s important hl color red 3 Many books and articles about CSS get confused when it comes to this terminology using these terms interchangeably or calling declarations attributes. In this book I used the W3C-endorsed terminology of declarations properties and values. I reserve the name attributes for attributes of HTML tags. 9 Licensed to siowchen@ Chapter 1 Getting the Lay of the Land The selector hl indicates that this rule applies to all hl headings in the document. The property that s being modified is color which refers to the font color. The .

crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.