Search
 
SCRIPT & CODE EXAMPLE
 

CSS

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%;
}
Comment

PREVIOUS NEXT
Code Example
Css :: disable checkbox click event 
Css :: @fontface otf 
Css :: ion-split-pane width 
Css :: selecting last child css 
Css :: setting multiple css using dom 
Css :: $scope.$apply 
Css :: scss how to use a variable in entire angular project 
Css :: title underline 
Css :: add expanding underline on page load css 
Css :: css cut lines 
Css :: rgb blue color code 
Css :: what does em stand for in css 
Css :: Add border to text - Css 
Css :: linux copy directory permissions to another directory 
Css :: overflow-x hidden not working 
Css :: fonmt family css 
Css :: css if element is empty 
Css :: how to remove underline from hyperlink css 
Css :: tailblocks 
Css :: line height tailwind 
Css :: bootstrap mb 
Css :: DOM element add multiple attributes 
Css :: ease in out css 
Css :: css scale 
Css :: background color in hex css 
Css :: how to put a circle in input 
Css :: hex color code for tan 
Css :: Css gradient animations 
Css :: text overflow css 
Css :: media types in css 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =