tailieunhanh - Learning Web Design Third Edition- P32

Learning Web Design Third Edition- P32: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. | Relative Positioning fixed The distinguishing characteristic of fixed positioning is that the element stays in one position in the window even when the document scrolls. Fixed elements are removed from the document flow and positioned relative to the browser window or other viewport . rather than another element in the document. Specifying position Once you ve established the positioning method the actual position is specified with four offset properties. NOTE Negative values are acceptable and move the element in the opposite directions. For example a negative value for top would have the effect of moving the element up. top right bottom left Values length measurement percentage auto inherit Default auto Applies to Positioned elements where position value is relative absolute or fixed Inherits no The values provided for each of the offset properties defines the distance the element should be moved away from that respective edge. For example the value of top defines the distance the top outer edge of the positioned element should be offset from the top edge of the browser or other containing element. A positive value for top results in the element box moving down by that amount. Similarly a positive value for left would move the positioned element to the right toward the center of the containing block by that amount. Further explanations and examples of the offset properties will be provided in the discussions of each postioning method. We ll start our exploration of positioning with the fairly straightforward relative method. Relative Positioning As mentioned previously relative positioning moves an element relative to its original spot in the flow. The space it would have occupied is preserved and continues to influence the layout of surrounding content. This is easier to understand with a simple example. Here I ve positioned an inline em element a background color makes its boundaries apparent . First I used the position property to set the method to relative .

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.