Đang chuẩn bị liên kết để tải về tài liệu:
Learning Web Design Third Edition- P22
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Learning Web Design Third Edition- P22:Everything you need to know to create professional web sites is right here. Learning Web Design starts from the beginning defining how the Web and web pages work and builds from there. By the end of the book, you'll have the skills to create multi-column CSS layouts with optimized graphic files, and you'll know how to get your pages up on the Web. | The Big Concepts p font-size small font-family sans-serif Figure 11-7. Certain properties applied to the p element are inherited by their children. Notice that I ve been saying certain properties are inherited. It s important to note that some style sheet proper ties inherit and others do not. In general properties related to the styling of text font size color style etc. are passed down. Properties such as borders margins backgrounds and so on that affect the boxed area around the element tend not to be passed down. This makes sense when you think about it. For example if you put a border around a paragraph you wouldn t want a border around every inline element such as em strong or a it contains as well. You can use inheritance to your advantage when writing style sheets. For example if you want all text elements to be rendered in the Verdana font face you could write separate style rules for every element in the document and set the font-face to Verdana. A better way would be to write a single style rule that applies the font-face property to the body element and let all the text elements contained in the body inherit that style Figure 11-8 . p font-size small font-family sans-serif Figure 11-8. All the elements in the document inherit certain properties applied to the body element. 196 Part III CSS for Presentation The Big Concepts Any property applied to a specific element will override the inherited values for that property. Going back to the article example we could specify that the em element should appear in a serif font and that would override the inherited sans-serif setting. Conflicting styles the cascade Ever wonder why they are called cascading style sheets CSS allows you to apply several style sheets to the same document which means there are bound to be conflicts. For example what should the browser do if a document s imported style sheet says that hl elements should be red but its embedded style sheet has a rule that makes hls purple The folks who .