How to add borders to text in css

藏色散人
Release: 2021-04-13 10:57:33
Original
11208 people have browsed it

How to add borders to text with css: First create an HTML sample file; then define the text content in the body; and finally add borders to the text through the "border: medium solid red" style.

How to add borders to text in css

The operating environment of this article: Windows7 system, HTML5&&CSS3 version, Dell G3 computer.

css adds borders to text:

CSS can perform pixel-level precise control of the layout of element positions in web pages, supports almost all font sizes and styles, and has the ability to control web pages Object and model style editing capabilities.

Let’s take a look at how to use css to add borders to text:

css can add borders to text through the border attribute.

The border abbreviation attribute is set in one statement. border properties.

The following attributes can be set in order:

border-width
border-style
border-color
Copy after login

Attribute value:

border-width specifies the width of the border.

border-style specifies the style of the border.

border-color specifies the color of the border.

inherit specifies that the setting of the border attribute should be inherited from the parent element.

Example:

<html>
<head>
<style type="text/css">
p 
{
border: medium solid red
}
</style>
</head>
<body>
<p>文字边框</p>
</body>
</html>
Copy after login

Rendering:

How to add borders to text in css

[Recommended learning: css video tutorial]

The above is the detailed content of How to add borders to text in css. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template