Home >Web Front-end >HTML Tutorial >No need for js, let css select the specified index element, compatible with _html/css_WEB-ITnose of lower versions of IE

No need for js, let css select the specified index element, compatible with _html/css_WEB-ITnose of lower versions of IE

WBOY
WBOYOriginal
2016-06-24 11:49:531020browse


As shown in the picture, there are 2 LIs. There is a gap between the first and the second one, and there is no gap between the left and the most. It requires support from a lower version of IE, such as IE6, 7, etc., only uses css. Is it possible?


Reply to discussion (solution)

Use conditional comments to determine the browser.

7101bd3b9a5d51f4ee9bb1f0efc22424
080b747a20f9163200dd0a7d304ba388
body{ background-color:#333;}
531ac245ce3e4fe3d50054a55f265927
d91fd4e7638da561dd14a1d1730ed3b9
ebfe8dd00e7ea47e29f0d93ec8c68f66
080b747a20f9163200dd0a7d304ba388
body{ background-color:#666;}
531ac245ce3e4fe3d50054a55f265927
1b771f47d72d900ba74308aee59557f0
266c419352a525843049eb7155ebf872
080b747a20f9163200dd0a7d304ba388
body{ background-color:#999;}
531ac245ce3e4fe3d50054a55f265927
1b771f47d72d900ba74308aee59557f0

and gt lt gte lte

Use conditional comments to determine the browser.

32bf6dd8d9e9c69afb95af0b0e5e6991
080b747a20f9163200dd0a7d304ba388
body{ background -color:#333;}
531ac245ce3e4fe3d50054a55f265927
1b771f47d72d900ba74308aee59557f0
ebfe8dd00e7ea47e29f0d93ec8c68f66
687c2c06e5a4995392a66a2c50c231d2
body{ background-color:#666;}
531ac245ce3e4fe3d50054a55f265927
1b771f47d72d900ba74308aee59557f0
d144afe7b4c1461d79bba4d17542f5d2
080b747a20f9163200dd0a7d304ba388
body{ background-color:#999;}
531ac245ce3e4fe3d50054a55f265927
099b48667cc570c8d4eae54f267e1485

How to make conditional judgment leave a gap between the first LI and the second LI in IE6 and 7?


Use conditional comments Determine the browser.

32bf6dd8d9e9c69afb95af0b0e5e6991
080b747a20f9163200dd0a7d304ba388
body{ background-color:#333;}
531ac245ce3e4fe3d50054a55f265927
1b771f47d72d900ba74308aee59557f0
ebfe8dd00e7ea47e29f0d93ec8c68f66