Answers for "text in horizontal line html"

1

CSS technique for a horizontal line with icons in the middle

<h1>Heading</h1>
<h1>This is a longer heading</h1>

h1 {
  overflow: hidden;
  text-align: center;
}

h1:before,
h1:after {
  background-color: #000;
  content: "";
  display: inline-block;
  height: 1px;
  position: relative;
  vertical-align: middle;
  width: 50%;
}

h1:before {
  right: 0.5em;
  margin-left: -50%;
}

h1:after {
  left: 0.5em;
  margin-right: -50%;
}
Posted by: Guest on October-14-2020
1

CSS technique for a horizontal line with icons in the middle

<h1>Heading</h1>
<h1>This is a longer heading</h1>

h1 {
  overflow: hidden;
  text-align: center;
}

h1:before,
h1:after {
  background-color: #000;
  content: "";
  display: inline-block;
  height: 1px;
  position: relative;
  vertical-align: middle;
  width: 50%;
}

h1:before {
  right: 0.5em;
  margin-left: -50%;
}

h1:after {
  left: 0.5em;
  margin-right: -50%;
}
Posted by: Guest on October-14-2020
1

how to add a horizontal line in html

We can add a horizontal line through the hr tag 
where you will put the hr tag it will create a hr tag 
it doesnt have a closing tag
<hr>
Posted by: Guest on June-05-2021
1

how to add a horizontal line in html

We can add a horizontal line through the hr tag 
where you will put the hr tag it will create a hr tag 
it doesnt have a closing tag
<hr>
Posted by: Guest on June-05-2021

Browse Popular Code Answers by Language