yibawuqing 2019-06-25
.close { position: relative; display: inline-block; width: 12px; height: 12px; } .close:before { content: ''; display: inline-block; position: absolute; top: 6px; width: 12px; border-top: 1px solid #ddd; transform: rotate(45deg); } .close:after { content: ''; display: inline-block; position: absolute; top: 6px; width: 12px; border-top: 1px solid #ddd; transform: rotate(-45deg); }
.arrow { display: inline-block; width: 8px; height: 8px; border-top: 1px solid #ddd; border-right: 1px solid #ddd; transform: rotate(45deg); }
.arrow { display: inline-block; width: 8px; height: 8px; border-bottom: 1px solid #ddd; border-left: 1px solid #ddd; transform: rotate(45deg); }
.arrow { display: inline-block; width: 8px; height: 8px; border-right: 1px solid #ddd; border-bottom: 1px solid #ddd; transform: rotate(45deg); }
.arrow { display: inline-block; width: 8px; height: 8px; border-top: 1px solid #ddd; border-left: 1px solid #ddd; transform: rotate(45deg); }
.triangle { position: relative; display: inline-block; width: 8px; height: 8px; overflow: hidden; } .triangle:after { content: ''; position: absolute; top: 2px; display: inline-block; border-top: 4px solid #ddd; border-right: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 4px solid transparent; }
.triangle { position: relative; display: inline-block; width: 8px; height: 8px; overflow: hidden; } .triangle:after { content: ''; position: absolute; bottom: 2px; display: inline-block; border-top: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 4px solid #ddd; border-left: 4px solid transparent; }
.triangle { position: relative; display: inline-block; width: 8px; height: 8px; overflow: hidden; } .triangle:after { content: ''; position: absolute; left: 2px; display: inline-block; border-top: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 4px solid #ddd; }
.triangle { position: relative; display: inline-block; width: 8px; height: 8px; overflow: hidden; } .triangle:after { content: ''; position: absolute; right: 2px; display: inline-block; border-top: 4px solid transparent; border-right: 4px solid #ddd; border-bottom: 4px solid transparent; border-left: 4px solid transparent; }
在明确了这些间隙产生的原因后,要去除这些间隙就变得容易多了,通常有以下集中办法去除这些间隙:。}优点:相比与设置负的margin-right大小的不确定性,设置font-size:0;显得更加好控制。