I have following html fragment:
<div>
<a class="item" href="http://google.com">Google</a>,
<a class="item" href="http://yahoo.com">Yahoo</a>,
<a class="item" href="http://yandex.com">Yandex</a>
</div>
Right now it is displayed like this:
Google, Yahoo, Yandex
And I need it to be displayed like this:
Google,
Yahoo,
Yandex
Can it be done ONLY by modifying CSS properties of .item class? (without inserting new tags (e.g. BR) and without touching comma sign)?
I've tried with
.item {
clear: both;
float: left;
}
But then all commas stay on the first line.
Maybe this can work,
add an empty string instead of adding a new comma in css and deleting or changing color of the old one
a:before {
content:'';
display: block;
}
jsFiddle DEMO
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With