Get the App
SLTechnology News&Howtos  ›  Development  › 

How to set the inner margin of CSS paragraph

Shulou Source: shulou.com Published: 2022-06-01 04:52:41 09月27日 Update

In this article, the editor introduces in detail the "how to set the inner margin of the CSS paragraph", the content is detailed, the steps are clear, and the details are handled properly. I hope that this article "how to set the inner margin of the CSS paragraph" can help you solve your doubts.

The following rule sets the inner margin of a paragraph to 10% of the parent element width:

P {padding: 10%;}

For example, if the parent element of a paragraph is the div element, then its inner margin is calculated according to the width of the div.

This paragragh is contained within a DIV that has a width of 200 pixels.

Note: the upper and lower inner margin is the same as the left and right inner margin; that is, the percentage of the upper and lower inner margin is set relative to the width of the parent element, not to the height.

What is the full name of css? the full name of css is Cascading Style Sheets (cascading style sheets), a computer language used to express file styles such as HTML or XML. CSS can not only modify the web page statically, but also format the elements of the web page dynamically with various scripting languages.

After reading this, the article "how to set the inner margin of the CSS paragraph" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it to understand it. If you want to know more about related articles, welcome to follow the industry information channel.

Tags: Paragraphs elements articles top and bottom full name content style web page language proper consistent dynamic width ideas documents new knowledge more formats steps percentage Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Docker macOS Shulou Tech Info Apple