I have a problem with pseudo-elements (: before,: after,: last-child) in the IE7 browser.
In fact I wanted to draw a tree that looks like this capture (IE11):
but when I execute my index on (IE7) gives me rendering wrong :
For information i have already used Selectivizr (It’s a JavaScript library that allows you to take advantage of CSS3 selectors ) but not working for me !
This code is just an example looks like my project structure where i use (struts2, dojo):
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tree</title>
<!--[if (gte IE 6)&(lte IE 8)]>
<script type="text/javascript" src="selectivizr.js"></script>
<![endif]-->
<link href="demo1.css" rel="stylesheet">
</head>
<body>
<div class="test">
<div>
<a href="#"> + </a>
<a href="#"> Label A </a>
</div>
<ul class="recherche_non_rendu">
<li>
<div class="test">
<div>
<a href="#"> + </a>
<a href="#"> Label A1 </a>
</div>
<ul class="recherche_non_rendu">
<li>
<div class="test">
<div>
<a href="#"> + </a>
<a href="#"> Label A11 </a>
</div>
</div>
</li>
<li>
<div class="test">
<div>
<a href="#"> + </a>
<a href="#"> Label A12 </a>
</div>
</div>
</li>
</ul>
</div>
</li>
</ul>
</div>
</body>
</html>
And my style css :
.test ul {
padding:0;
margin: 0;
margin-left:6px;
list-style:none;
background: #fff;
color:#000;
position:relative;
}
.test ul:before {
content:"";
position:absolute;
top:0;
bottom:0;
left:0;
border-left:1px solid #000;
}
.test li {
margin:0;
padding:0 16px;
line-height:2em;
font-weight:bold;
position:relative;
}
.test li:before {
content:"";
display:block;
width:10px;
height:0;
border-top:1px solid #000;
margin-top:-1px;
position:absolute;
top:1em;
left:0;
}
.test li:last-child:before {
background:white;
height:auto;
top:1em;
bottom:0;
}
Any help will be appreciated.