Image is not clickable inside anchor only in IE7

后端 未结 12 1665
孤城傲影
孤城傲影 2021-02-04 05:16

Html Structure


      
   
   
    Some text 
<         


        
12条回答
  •  Happy的楠姐
    2021-02-04 06:05

    Ah another hasLayout quirk

    it's not possible to achieve in IE7 and still retain the width of the span, if you could show what you're trying to achieve in a JS fiddle perhaps we could help, find a way around it e.g. and this is only a guess, putting the width on the anchor with some padding would help create a completely clickable area and still allow a "caption" span to be restrained if that's what you're after..

    Example workaround not a fix

    CSS:

    a {
      display: inline-block;
      background: #ff0; 
      max-width: 50px; 
      padding: 10px; 
      text-align: center;
    }
    
    img {border: 0; display: block; margin-bottom: 10px;}
    span {line-height: 1.5;}
    

    HTML:

    
       
       Some text and even longer
    
    

    The above is only a thought, and if it's not what you're after, then please provide a sample jsfiddle.net

提交回复
热议问题