A new understanding of sliding door layout

Source: Internet
Author: User
CSS in the sliding technology for beginners is a relatively fresh topic, for the text of the picture in the left and right layout of the author from the perspective of their own understanding to make the following interpretation.



The picture is divided into two parts: left and right. In the right picture, put text and links, and slide with the different text. The left picture is the same size.

So let's first fix the left position in the definition of Li, which is to set the left image to the background and to the left to align: Background:url ("Left.gif") no-repeat to top;

In order for the right graph to be closely connected with the left image (the width of the left figure is 9px), and does not overlap, set Li's left interior margin to 9px:padding:0 0 0 9px;

#header li {float:left background:url ("Left.gif") no-repeat left top; margin:0 0 0 9px; }
The right figure is defined in child element A, and the child element A is contained within the parent element Li, then the child element A has a distance of 9px from the left, that is, the child element A from the right edge of the left graph, then we set the background of child element A in the right picture, and, on the right, align: Background:url (" Right.gif ") No-repeat right top;

Set the margin for text in child element A: padding:5px 15px 4px 6px; (To center the position of the text in Li, set the left inner margin in child element A to 15px-9px=5px.)

#header a{display:block background:url ("Right.gif") No-repeat right top; padding:5px 15px 4px 6px;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.