IE678 solves the problem of pseudo-class last-child incompatibility, ie678last-child

Source: Internet
Author: User

IE678 solves the problem of pseudo-class last-child incompatibility, ie678last-child

For the following content, see segmentfault

To solve the compatibility problem of ie678, it is generally better to use less of the unique attributes of css 3 and html5, Or do css hacker.Last-childIt is generally used to clear float, add tags in batches, remove delimiters between tagsList itemThe last border-right and so on.

UseLast-childWhen floating is cleared, an unique ie attribute is usually added.Zoom: 1To handle compatibility issues.

.clearfix::after {    display: block;    visibility: hidden;    height: 0;    clear: both;    content: "";}.clearfix {    clear: both;    zoom:1;}

When you need to use it to add tags in batches, you can use jquery instead. You can manually add or replace fewer tags.

RemoveList itemThe lastBorder-rightYou can use the negative margin:

Beauty of negative values: application of negative values in page layout

CSS layout-powerful negative margin

Another method is to useCss2Selectorelement+elementThat is, one element is followed by another element selector. Use

li+li{border-top: 1px dotted #999;}

In this way, the separator is added to each of the following records, so that the last border-right result is not generated.

<ul>    <li>sample text</li>    <li>sample text</li>    <li>sample text</li>    <li>sample text</li>    <li>sample text</li>    <li>sample text</li></ul>

If it is notTableThe layout merge border is directly set in the borderMargin-1pxYou can use

margin-right: -1px;margin-bottom: -1px;

Merge repeated borders

<!DOCTYPE html>

 

 

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.