This article introduces the sample code of CSS to achieve the effect of horizontal lines on both sides of the text center, and shares it with you. The specific notes are as follows: Effect: <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <style> .title{ text-align: center; position: relative; height: 50px; line-height: 50px; width: 800px; margin: 200px auto; } .title:after,.title:before{ content: ""; position: absolute; top: 50%; background: #7a7a7a; height: 1px; width: 35%; } .title:after{ left: 0; } .title:before{ right: 0; } </style> </head> <body> <div class="title">CSS to achieve the effect of horizontal lines on both sides of the text center</div> </body> </html> The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. |
<<: Steps to restore code from a Docker container image
>>: H tags should be used reasonably in web page production
When nginx configures proxy_pass, the difference ...
(When a web page is loading, sometimes there is t...
docker-compose-monitor.yml version: '2' n...
1. First install node, express, express-generator...
Preface The effect problems used in personal actu...
1. Install components yum install epel-rpm-macros...
As Web developers, although we are not profession...
Table of contents 1. Transition from development ...
When implementing this function, the method I bor...
When using docker images, images with both REPOSI...
Part 1: Basics 1. Unlike pseudo-classes such as :...
1. Style object The style object represents a sin...
The relevant person in charge of Baidu Input Metho...
Background requirements: The ERP system needs to ...
apt install CMake sudo apt install cmake This met...