Created
January 24, 2011 21:43
-
-
Save timgthomas/794020 to your computer and use it in GitHub Desktop.
Using CSS to create an image banner within an H1 tag
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
<!DOCTYPE html> | |
<html lang="en"> | |
<body> | |
<h1>My Site</h1> | |
<p>Lorem ipsum...</p> | |
</body> | |
</html> |
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
h1 { | |
background-image: url('MySite-Banner.png'); | |
display: block; | |
text-indent: -9999px; /* Hide the H1's text from the screen */ | |
height: 50px; | |
width: 200px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment