Last active
August 29, 2015 14:10
-
-
Save CoralSilver/1fbaeaf4e30dc1b9a32d to your computer and use it in GitHub Desktop.
Responsive CSS logo image replacement with <a> 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
.logo { | |
height: 80px; | |
width: 100%; | |
max-width: 290px; | |
} | |
/*Using Scott Kellum CSS image replacement technique and based on this tut: http://tutvid.com/webdesign/css-tutorial-image-replacementlink-logo-to-homepage/*/ | |
.logo-image { | |
display: block; | |
background: url(../imgs/logo.png) no-repeat; | |
margin: 0; | |
text-indent: 100%; | |
white-space: nowrap; | |
overflow: hidden; | |
background-size: 100% auto; | |
width: 100%; | |
height: 100%; | |
} | |
/*This can be added to make logo retina-ready*/ | |
@media only screen and (-webkit-min-device-pixel-ratio: 1.2), only screen and (min-device-pixel-ratio: 1.2) { | |
.logo-image { | |
background-image: url(../imgs/[email protected]); | |
} | |
} |
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 class="logo text-left"> | |
<a class="logo-image" href="index.html">Logo Text</a> | |
</h1> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment