简体   繁体   English

包含其他字体大小不同的段落的段落

[英]Paragraphs wrapping other paragraphs of different font sizes

This is difficult to explain 这很难解释

I have a div tag that includes many p tags. 我有一个div标签,其中包含许多p标签。 These p tags are varying font sizes up to 250. 这些p标签的字体大小最大为250。

I would like the text to wrap the larger font sizes. 我希望文本包含较大的字体。 For instance, if I have a paragraph with the work "ok" with a font size of 250, I want the other paragraph tags to wrap around it instead of having one line like it is now. 例如,如果我有一个段落,其工作尺寸为“ ok”,字体大小为250,则我希望其他段落标签环绕它,而不是像现在这样一行。 This must remain a single div tag containing multiple p tags. 这必须保留一个包含多个p标签的div标签。 Here are images explaining what I mean: http://imgur.com/0ED1cS6 以下是解释我意思的图片: http : //imgur.com/0ED1cS6

I should add, the order of the other paragraphs do not matter, they can be completely random just as long as there are multiple lines wrapping the larger fonts, so the last paragraph can be at the top. 我应该补充,其他段落的顺序没有关系,只要有多行包裹较大的字体,它们就可以是完全随机的,因此最后一段可以位于顶部。 Whichever can fit the most text in the smallest area is what I am looking for. 我要寻找的是在最小区域内适合最多文本的那个。

I have put an example on jsfiddle, asdf, qwer, sd, and ds should be stacked on top of each other beside test http://jsfiddle.net/rfcy2f15/1/ 我在jsfiddle上放了一个示例,在test http://jsfiddle.net/rfcy2f15/1/旁边应将jsfiddle, asdf, qwer, sd, and ds相互堆叠

Sorry about my english and I'n not sure that I understand you but this could help you: http://jsfiddle.net/4kLyxgpx/ 抱歉,我的英语不好,我不确定我是否了解您,但这可以为您提供帮助: http : //jsfiddle.net/4kLyxgpx/

p {
    display: block;
    line-height: 100%;
    margin: 0;
}

And HTML: 和HTML:

<div>
    <p style='font-size: 100px;display: inline; float:left;'>test</p>
    <p style='font-size: 20px;'>asdf</p>
    <p style='font-size: 12px;'>qwer</p>
    <p style='font-size: 10px;'>sd</p>
    <p style='font-size: 10px;'>ds</p>
    <p style='font-size: 40px;'>csd</p>
    <p style='font-size: 10px;'>werw</p>
</div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM