I have something like following
<a class="item" href="a.htm">
<div class="title">abcd</div>
<div class="body">abcd</div>
</a>
with the following style
a.item {
display:block;
}
As soon as I add another anchor tag inside a.class,
<a class="item" href="a.htm">
<div class="title">abcd</div>
<div class="body">abcd</div>
<a class="child" href="b.html">child</a>
</a>
even though I have
a.child {
display:inline
}
it breaks the child into a separate block. How do I go around this?
You cannot nest
<a>elements. Replace either of the<a>with<span>. Since you’ve got twohrefattributes, I assume that you want the following effect:Demo: http://jsfiddle.net/jE6Dm/
CSS:
HTML: