我有一个固定宽度的div,包含一堆链接,每个链接都有文字,文字之间没有空格。固定宽度div内的包装链接
我试图实现的是当链接命中div的边缘时,整个链接沿着一条线移动。
我刚刚在JSFiddle中玩过,最初我有一个长的未格式化(没有标签在新行等)的一块html,并观察最后一个链接,而不是移动到一个新行。
然后我决定重新格式化,所以把新的标签放在行上,这样做后,最终的标签现在移动到一个新的行,当它受到div的宽度限制。
我实际上是从一个脚本动态生成html,目前它只是为我生成一个单一的连接字符串然后渲染。下面是我使用的HTML和工作捣鼓出这两种方法的结果:
http://jsfiddle.net/8gdez8ur/2/
<div style="width: 350px; overflow: hidden;"><a href="#" action="zoom" style="font-size:11px;padding-right:2px;">Zoom</a><a action="streetview" href="#" style="font-size:11px;padding-right:2px;"> Street View</a><a action="addplacemarker" href="#" style="font-size:11px;padding-right:2px;">Add Placemarker</a><a action="route" href="#" style="font-size:11px;padding-right:2px;">ETA To</a><a action="reportproblem" href="#" style="font-size:11px;padding-right:2px;">Incorrect Location Details</a><a action="sendmessage" href="#" style="font-size:11px;">Send Message</a></div>
<hr>
<div style="width: 350px; overflow: hidden;">
<a href="#" action="zoom" style="font-size:11px; padding-right:2px;">Zoom</a>
<a action="streetview" href="#" style="font-size:11px; padding-right:2px;">Street View</a>
<a action="addplacemarker" href="#" style="font-size:11px; padding-right:2px;">Add Placemarker</a>
<a action="route" href="#" style="font-size:11px; padding-right:2px;">ETA To</a>
<a action="reportproblem" href="#" style="font-size:11px; padding-right:2px;">Incorrect Location Details</a>
<a action="sendmessage" href="#" style="font-size:11px; padding-right:2px;">Send Message</a>
</div>
为什么会出现这里活动的差异? 感谢
存在“填充右:2px的”失踪 –
感谢您指出了这一点,但它并不能帮助我在这种情况下 – mindparse
退出空间之前, “Street&nbsp”in first div –