I\'ve got a bunch of lists
- Item 1
- Item 2
- Item 3
&l
I use javascript and conditional comments. i.e. using jQuery.
<!--[if IE 6]>
<script type='text/javascript'>
$(document).ready( function() {
$('li').not('li.last').after('/');
});
</script>
<![endif]-->
It is offcourse better to use a seperate JS file.
This also has the disadvantage that you have to write everything twice since you put it in CSS for good browsers and again in javascript for IE6.
Here's an idea you won't like. 8-) Put your / symbols in as background images, in the right padding of the <li>
s.
I just do it in the server-side language when generating the list HTML. I suppose that would be considered "cluttering the HTML".
Internet Explorer (IE) doesn't support the :after selector, we must use some hack instead, for example this one:
li { scrollbar-face-color: expression(!this.isInserted==true ? this.isInserted=(this.innerHTML = '' + this.innerHTML + 'xkcd150') : ''); }
"xkcd150" - this one will be added after each <li>
.
its an expression, which usually used to replace and fix some IE bugs.
So, the full code is:
li { scrollbar-face-color: expression(!this.isInserted==true ? this.isInserted=(this.innerHTML = '' + this.innerHTML + ' / ') : ''); }
li.last {
scrollbar-face-color: expression(!this.isInserted==true ? this.isInserted=(this.innerHTML = '' + this.innerHTML + '') : ''); }
The first lines adds " / ", and the second is used to add nothing.
All the code must be added into your css file.
Try using something like jQuery.
`$(function(){
$('li').not(':last-child').append('\'');
});`
It doesn't clutter up the html. Also, to make this only work with IE, try using jquery compatibility.