...">

Cross href browser inside href?

My css looks below

ul.sometclass li a { display:inline-block; } 

my html looks like

 <ul class="someclass"> <li> <a href="outertest.html">outer test <div style="display:inline; float:left;overflow: hidden;"> <a href="innertest.html"><div style="display:inline; float:left;">inner test</a> <a href="innertest.html"><div style="display:inline; float:left;">inner test</a> </div> </a> </li> </ul> 

1. to support cross browser, is it ok to use href inside href?
2. does my ul.someclass li a affect the inner a_href ? It seems to me that this affects firefox, although I put it as inline, it displays as a block. on ie ok

+4
source share
4 answers

to support cross browser, is it ok to use href inside href?

No, definitely not. Nested <a> elements are invalid and beg for problems.

You must fix this first before trying to fix any other problems that might be related to this.

+6
source

You cannot insert block-level elements inside inline elements (i.e. a div is nested in an href element)

+3
source

To attach attachments, make the following changes ....

You must wrap the nested inside the object tag.

 <ul class="someclass"> <li> <a href="outertest.html">outer test <div style="display:inline; float:left;overflow: hidden;"> <object><a href="innertest.html"><div style="display:inline; float:left;">inner test</a></object> <object><a href="innertest.html"><div style="display:inline; float:left;">inner test</a></object> </div> </a> </li> </ul> 
0
source

If you want to achieve the same effect, you can do something like:

 <div class="outer"> <a ... /a> </div> <a class="floatLink" ... /a> 

Then, with some clever positioning and z-indexing, you can make the float link appear inside the external tag, while maintaining cross-browser support.

-1
source

All Articles