Code Snippet
Triangular List Bullets
ul {
margin: 0.75em 0;
padding: 0 1em;
list-style: none;
}
li:before {
content: "";
border-color: transparent #111;
border-style: solid;
border-width: 0.35em 0 0.35em 0.45em;
display: block;
height: 0;
width: 0;
left: -1em;
top: 0.9em;
position: relative;
}
tricks are very impressive,,,
but I greatly admire the comments .. suppose blogspot platform can be like this …
Now… how do I make them rotate downward when the menu/list items expand? Preferably sans-jquery… CSS only.
I saw an example, you’re talking about, here http://www.artlebedev.ru/tools/technogrette/html/treeview/
In your case you may try to hide related ul content and display it on hover (using css) and rotate triangle by using
li:hover:before { border-width: 0.45em 0.35em 0 0.35em ; }Maybe transitions will also be helpfull, I dunno.
Here’s a bit of tweaking I did really quickly… I tried a few things and couldn’t find an efficient way to animate the transform for when the hover starts and ends. I suppose if you used javascript you could do something like that, but this snippet is pure css.
Partnered with this:
Awesome trick. However, here we go, IE 7 does not show the triangle bullets, is there a workaround band-aid approach to this (hack)?
Javi: IE7 does not support the :before and :after pseudo elements.
I was going to suggest using the Selectivizr script which adds a lot of CSS3 selector functionality to IE 6-8, but it does not support those pseudo elements either. Apparently this is because :before and :after cause changes to the DOM which might cause some of Selectivizr’s other functionality to fail.
So, unless someone else has a clever workaround, I guess your only option is to feed IE7 a separate rule via conditional comments, perhaps using background images as list markers.
Here’s a working (if somewhat lengthy) method:
CSS:
HTML
DigWP
A book and blog co-authored by Jeff Starr and myself about the World's most popular publishing platform.
Quotes on Design
Design, like Art, can be an elusive word to define and an awfully fun thing to have opinions about.
HTML-Ipsum
One-click copy to clipboard access to Lorem Ipsum text that comes wrapped in a variety of HTML.
Bookshelf
Hey Chris, what books do you recommend? These, young fertile mind, these.