TAILIEUCHUNG - Learning Web Design Third Edition- P33

Learning Web Design Third Edition- P33: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. | Absolute Positioning Stacking order Before we close the book on absolute positioning there is one last related concept that I need to introduce. As we ve seen absolutely positioned elements overlap other elements so it follows that multiple positioned elements have the potential to stack up on one another. By default elements stack up in the order in which they appear in the document but you can change the stacking order with the z-index property. Picture the z-axis as a line that runs perpendicular to the page as though from the tip of your nose through this page and out the other side. z-index Values number auto inherit Default auto Applies to positioned elements Inherits no The value of the z-index property is a number positive or negative . The higher the number the higher the element will appear in the stack. Lower numbers and negative values move the element lower in the stack. Let s look at an example to make this clear Figure 15-19 . Here are three paragraph elements each containing a letter image A B and C respectively that have been positioned in a way that they overlap on the page. By default paragraph C would appear on top because it appears last in the source. However by assigning higher z-index values to paragraphs A and B we can force them to stack in our preferred order. Note that the values of z-index do not need to be sequential and they do not relate to anything in particular. All that matters is that higher number values position the element higher in the stack. The markup p id A img src alt A p p id B img src alt B p p id C img src alt C p The style sheet A z-index 10 position absolute top 200px left 200px B z-index 5 position absolute top 225px left 175px 306 Part III CSS for Presentation Fixed Positioning C z-index 1 position absolute top 250px left 225px top of lower values. Figure 15-19. Changing the stacking order with the z-index property. To be honest the z-index property is not often required for most page layouts but

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.