选择受div放置影响的元素

时间:2013-10-25 08:25:13

标签: html

      <span class="a" dojoAttachPoint="apoint"></span>  
      <span class="b"   dojoAttachPoint="bpoint">hyperlinked msg</span>
      <span class="c" dojoAttachPoint="cpoint"></span>
      <div>Hello</div>

的CSS:

      .a, .b, .c{
            float:left
      }

现在,当我选择超链接消息时,它也会选择下一个div的文本'Hello'。为了避免这个问题,我将代码更改为

      <div>Hello</div>
      <span class="a" dojoAttachPoint="apoint"></span>  
      <span class="b"   dojoAttachPoint="bpoint">hyperlinked msg</span>
      <span class="c" dojoAttachPoint="cpoint"></span>

这解决了这个问题。任何人都可以解释一下这个问题是如何解决的?

1 个答案:

答案 0 :(得分:0)

你忘了你的流量:

<span class="a" dojoAttachPoint="apoint"></span>  
<span class="b"   dojoAttachPoint="bpoint">hyperlinked msg</span>
<span class="c" dojoAttachPoint="cpoint"></span>
<div style="clear:both"></div>
<div>Hello</div>

CSS

.a, .b, .c{
            float:left
      }

faq clear