Home > Article > Web Front-end > What does p mean in css
The
p element represents a paragraph style in CSS. It is displayed as a block-level element by default. The text color is black and the line height is equal to 1.5 times the font size. The style of the p element can be customized through CSS, including font, text color, alignment, margins and padding, etc.
The p element in CSS
p
element is a paragraph element in HTML. In CSS, it stands for paragraph style.
Default Style
##
The default style of the element in most browsers is as follows:
Display the element as a block-level element, occupying one line width
Set the upper and lower edges of the element to 1em
Set the font size to 1em
Set the line height to 1.5 times the font size
Set the text color to black
Custom style
You can use CSS top element to customize the style, for example:
Font style:
Specify font family
Set font size
Set font weight
Text color and background:
Set text color
Set background color
Alignment:
Setting Text alignment
Margins and padding:
Set elements Margin
Set the inner margin of the element
The following CSS code sets the font size of the
p element to 1.2em, Set the font color to blue and add 2em margins above and below the element: <pre class="brush:php;toolbar:false"><code class="css">p {
font-size: 1.2em;
color: blue;
margin: 2em 0;
}</code></pre>
The above is the detailed content of What does p mean in css. For more information, please follow other related articles on the PHP Chinese website!