Home > front end >  How to let the p tag not line
How to let the p tag not line

Time:09-25


<meta charset="utf-8" & gt;


<style type="text/css">
P {display: inline; }
H1 {text - align: left;
The font - size: 10;
font-size: 15px;
Color: darkgray}
The h2 {color: red; }

H3 {text - align: left;
}

The strong {30 px; the font size:
Color: # 006400;
}


The test1 span {color: # 0000 ff; }

</style>

Ordinary paragraph text & lt; Br>
Specifies the. Special class of paragraph text & lt; Br>


Specifies the. The title of the special kind of text & lt; Hr/& gt;

Paragraph text & lt;/h3 & gt;

Nested in the paragraph, strong tags used to define the text (red), & lt;/span>






CodePudding user response:

P tag CSS:
White - space: nowrap

CodePudding user response:

P tags non-breaking
P {display: inline; }

P tags in the text does not wrap the
P {white - space: nowrap; }

CodePudding user response:

Conversion element in line, or white space: nowrap

CodePudding user response:

To start with your HTML code, please strict guarantee label to contain and nested, such as

Paragraph text & lt;/h3 & gt;
This is obviously problematic, not rigorous code browser, although not an error, but will bring some unpredictable problems

So say about non-breaking, divided into the content of dom non-breaking and dom container non-breaking
Content non-breaking can define as upstairs said the style of the container, such as
P {white - space: nowrap; }
So p tags inside the text will not wrap, if the content more and there is no overflow: hidden coordination, will surpass container content

If you don't wrap is dom container, ordinary block-level elements can use float and comply with a parent container wide enough to implement
Level also can put the block-level element casting lines or block-level elements, and cooperate with the parent container of white - space: nowrap to not line, this kind of practice is to make as a block-level element dom elements into a row level, as if the block-level elements as the parent container text content

  • Related