gpt4 book ai didi

jquery - 有什么方法可以证明单段落行的合理性吗?

转载 作者:行者123 更新时间:2023-12-01 07:26:27 26 4
gpt4 key购买 nike

;这可能吗?

我有很多单行段落,它们都最多需要 1 行(由于每个段落都有不同的功能)。我可以使用 css 将它们全部设置为宽度,或者(我目前拥有的):

var max = 0;
$(this).find('p').each(function(){
if ($(this).width() > max)
max = $(this).width();
});
$(this).find('p').width(max);
});

text-align: justify; <<< does nothing to one line

但是有没有办法证明一行的合理性呢?没有或有字母间距计算?或者有效的 css3 解决方案?

最佳答案

我就知道会有be an answer使用 :after

p {
text-align: justify;
}
p:after {
content: "";
display: inline-block;
width: 100%;
}

http://jsfiddle.net/Q5kxP/1/

简单有效。支持Vjeux寻求解决方案。

关于jquery - 有什么方法可以证明单段落行的合理性吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9244661/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com