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
Preface I wrote a few examples using vue3, and I ...
Physical Structure of an InnoDB Index All InnoDB ...
First, pull the image (or just create a container...
1) Introduction to cache mechanism In the Linux s...
This article shares with you the solution to the ...
In projects, batch operation statements are often...
Table of contents Spring Boot Docker spring-boot-...
This article shares the installation tutorial of ...
Disadvantages of single-node database Large-scale...
If the server data is not encrypted and authentic...
Since myeclipse2017 and idea2017 are installed on...
Excel is the most commonly used tool for data ana...
XML files should be encoded in utf-8 as much as p...
1. It is best to add a sentence like this before t...
Core code /*-------------------------------- Find...