Last active
March 13, 2019 16:48
-
-
Save rowej83/554275a191329b18fddd to your computer and use it in GitHub Desktop.
Create a header with a line running behind it. Includes html and css required
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
ADD CSS TO STYLE SHEETS TO USE | |
.line-container { | |
position: relative; | |
text-align: center; | |
z-index:10; | |
} | |
.line-container:before { | |
content: ""; | |
display: block; | |
position: absolute; | |
z-index: -1; | |
top: 50%; | |
width: 100%; | |
border-bottom: 3px solid black; | |
} | |
.line-container span { | |
text-align: center; | |
background-color: white; | |
padding: 0 0.3em; | |
} | |
--> | |
<h2 class="line-container"> | |
<span>Hello World</span> | |
</h2> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment