Home > Article > Web Front-end > How to add spaces in css
There are 5 ways to add spaces in CSS: whitespace characters, tab characters, inline block elements, white-space attributes and text-indent attributes.
Add spaces in CSS
In CSS, there are several ways to add spaces:
1. Use
(space character) or
Add spaces to CSS property values. margin-right: 20px;
2. tab
Characters
\t
(tab escape sequence) to add tab characters to CSS property values. padding-left: 2\tt;
##3. display: inline-block;
4. white-space Properties
(default): Keep spaces and newlines.
: Preserves spaces and newlines and displays them as preformatted text.
: No line breaks, eliminate spaces.
5. text-indent Attributes
The above is the detailed content of How to add spaces in css. For more information, please follow other related articles on the PHP Chinese website!