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+element,That 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>