tailieunhanh - Learning Web Design Third Edition- P11
Learning Web Design Third Edition- P11: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. | Generic Elements div and span div . div Generic block-level element span . span Generic inline element Generic Elements div and span There are endless types of information in the world but as you ve seen not all that many semantic elements. Fortunately X HTML provides two generic elements that can be customized to describe your content perfectly. The div short for division element is used to indicate a generic block-level element while the span element is used to indicate a generic inline element. You give a generic element a name using either an id or class attribute we ll talk about those more in just a moment . The div and span elements have no inherent presentation qualities of their own but you can use style sheets to format the content however you like. In fact generic elements are a primary tool in standards-based web design because they enable authors to accurately describe content and offer plenty of hooks for adding style rules. We re going to spend a little time on div and span as well as the id and class attributes also called element identifiers because they will be powerful tools once we start working with Cascading Style Sheets. Let s take a look at how authors use these elements to structure content. Divide it up with a div MARKUP TIP It is possible to nest div elements within other div elements but don t go overboard. You should always strive to keep your markup as simple as possible so only add a div element if it is necessary for logical structure or styling. The div element is used to identify a block-level division of text. You can use a div like a container around a logical grouping of elements on the page. By marking related elements as a div and giving it a descriptive name you give context to the elements in the grouping. That comes in handy for making the structure of your document clear but also for adding style proper ties. Let s look at a few examples of div elements. In this example a div element is used as a container to group an .
đang nạp các trang xem trước