css连接_用CSS包装长链接

css连接

Developers have loads to think about when creative websites, and much of that is ensuring child elements don't stretch past the parent width.  We worry about images, IFRAMEs, and other popular elements pushing past their parent width, but then we see a basic link with a long URL and we look down, just shaking our heads.  Why doesn't the URL just break?

开发人员需要考虑何时创建创意网站,其中大部分是确保子元素不会超出父元素的宽度。 我们担心图像,IFRAME和其他流行元素会超出其父级宽度,但是随后我们看到一个基本链接的URL长,然后我们低下头,只是摇了摇头。 为什么URL不会中断?

To prevent that issue, you can apply the following CSS:

为避免该问题,您可以应用以下CSS:


/*
	Problem:  

	<a href="">//someurl.com/a-really-really-really-really-really-really-really-really-really-long-url</a>
*/
a {
	word-wrap: break-word;
}


Should this be a global setting for A elements, or simply something that we as developers should set?  Surely this is an annoyance we shouldn't have to deal with, right?

这应该是A元素的全局设置,还是仅仅是我们作为开发人员应该设置的内容? 当然这是我们不应该处理的烦恼,对吗?

翻译自: https://davidwalsh.name/fix-long-link-wrapping

css连接

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值