作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有这个 HTML:
<div style="word-wrap: normal; width: 20rem; max-width: 30rem; border: 1px solid red;">
already, always, very - a word or phrase that modifies or qualifies an adjective, verb, or other adverb or a word group, expressing a relation of place, time, circumstance, manner, cause, degree, etc. (e.g., gently, quite, then, there ).
</div>
如果<div>
,我想要的是让文本在内部环绕自己.但是它溢出并且根本不做任何环绕。
有没有办法让它环绕而不是从 <div>
的右侧流出? ?
最佳答案
文字没有溢出,有背景就可以看。您可以通过添加使其更规则
text-align: justify; text-align-last: left
<div style="word-wrap: normal; width: 20rem; max-width: 30rem; background: #cacaca">
already, always, very - a word or phrase that modifies or qualifies an adjective, verb, or other adverb or a word group, expressing a relation of place, time, circumstance, manner, cause, degree, etc. (e.g., gently, quite, then, there ).
</div>
<div style="word-wrap: normal; width: 20rem; max-width: 30rem; text-align: justify; text-align-last: left">
already, always, very - a word or phrase that modifies or qualifies an adjective, verb, or other adverb or a word group, expressing a relation of place, time, circumstance, manner, cause, degree, etc. (e.g., gently, quite, then, there ).
</div>
关于html - 如何让文本在 <div> 内环绕?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42251880/
我是一名优秀的程序员,十分优秀!