html - HTML anchor 标记中超链接文本的内联换行

标签 html css formatting hyperlink

我正在尝试找到一种方法,让 HTML 链接中的超长文本能够换行,同时将链接包含在一个紧凑的矩形中。

基本上,我想要这个:

                      with a really, really
    Here is some text long link that wraps   and here is some more text.
                      around in a rectangle

代替:

   Here is some text with a really, really long link that wraps
   around in a rectangle and here is some more text.

我该怎么做?

最佳答案

你可以在 Firefox 中这样做 - 但它在 IE 中不起作用:(

<p>Here is some text <a href="#">with a really, really long link that wraps</a> around in a rectangle and here is some more text.


<style type="text/css">

a {display: inline-block; max-width: 100px; vertical-align: middle;}

</style>

关于html - HTML anchor 标记中超链接文本的内联换行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/646657/

相关文章:

html - FireFox 16px DIV 之间的间隙问题

javascript - Robin Herbots jquery.inputmask 允许多个值以逗号分隔

css - 奇怪的清除栏

html - 在一个 div 中每行有 4 张图片

javascript - 当文本字段中有特定值时如何选中复选框

html - 页脚不在内容的末尾

python - Matplotlib 为所有图勾选无衬线字体

r - 将选定的线保留在 x Axis 上,并在 Y Axis 上的特定部分标记

javascript - jquery load() 等效于离线使用

php - 按钮网格间距