Below is a code snippet that showcases the issue I'm currently facing. jsFiddle Demo
<div class="normal">
<a href="#">Test</a>
<a href="#">Test longer</a>
</div>
<div class="ib blockbyclass">
<a href="#">Test</a>
<a href="#">Test longer</a>
</div>
<div class="ib">
<a href="#" style="display: block;">Test</a>
<a href="#" style="display: block;">Test longer</a>
</div>
body{background-color: gray;}
div{float:left; margin: 5px;}
a {background-color: black; color: white;}
div.ib a {display: inline-block;}
div.normal > a {display: block;}
div.blockbyclass> a {display: block; }
I'm facing an issue where a specific type of link needs to be rendered differently based on certain conditions. Although I require them to be inline-block in most scenarios, there are cases where they must be block elements. These links should be displayed individually on separate lines, occupying the entire space of the containing div. Despite successful rendering in IE8, IE9, Firefox, and Chrome, IE7 stubbornly adheres to the display: inline-block rule.
What is the best approach to force IE7 to display these elements in "block" mode?