+ 2
How to put a text in between a line?
For example: -----------------text here----------------
3 Answers
+ 3
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<style>
.container{
width:100%;
display:flex;
align-items: center;
}
.line{
background-color: #000;
/* set the percentage the width of eac part of the line sould occupy here */
width:40%;
/* set the heigth of the line here */
height: 4px;
}
.text{
text-align:center;
/* set the percentage of the width of the text here */
width:20%;
}
</style>
</head>
<body>
<div class="container">
<div class="line"></div>
<p class="text">Text here</p>
<div class="line"></div>
</div>
</body>
</html>
https://code.sololearn.com/Wg85zJVaV5PL/?ref=app
+ 1
No I mean, as you can put a horizontal line , now I want that line to have a text between it
0
The line would be some element's border.