C
Christoph Burschka
I need to generate an invisible anchor element (JS widget) to overlay
the list style icon in a nested list.
I'm currently doing this with the following markup:
<ul class="tree">
<li class="item">
<a class="menu-icon" href="#"> </a>
<a class="menu-link" href="/menu/link">Menu Link</a>
<ul class="tree">
...
</ul>
</li>
</ul>
And the following CSS:
a.menu-icon {
position: relative;
left: -2em;
margin-right: -1em;
}
Needless to say, the is extremely ugly, and very likely to break
with different text sizes and different fonts (this mechanism is part of
a module that will be used with many different layouts)
Unfortunately, forcing the link width with a.menu-icon { width: 16px; }
didn't work, and if I use a "display:block", the menu link will be
broken to the next line.
Is there a way to set a fixed width on this invisible anchor?
Thanks,
the list style icon in a nested list.
I'm currently doing this with the following markup:
<ul class="tree">
<li class="item">
<a class="menu-icon" href="#"> </a>
<a class="menu-link" href="/menu/link">Menu Link</a>
<ul class="tree">
...
</ul>
</li>
</ul>
And the following CSS:
a.menu-icon {
position: relative;
left: -2em;
margin-right: -1em;
}
Needless to say, the is extremely ugly, and very likely to break
with different text sizes and different fonts (this mechanism is part of
a module that will be used with many different layouts)
Unfortunately, forcing the link width with a.menu-icon { width: 16px; }
didn't work, and if I use a "display:block", the menu link will be
broken to the next line.
Is there a way to set a fixed width on this invisible anchor?
Thanks,