Last active
December 18, 2015 08:29
-
-
Save ghernandez345/5754028 to your computer and use it in GitHub Desktop.
how to properly expand anchor tags when they contain children.
This file contains hidden or 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
<!-- this anchor contains some other html elements as it's children. By default it will NOT | |
expand to the size of its children. It's demensions in the browser will be 0x0 until you implement the correct css. --> | |
<a href="#someLink" class="some-link-button"> | |
<div class="button">Click here</div> | |
</a> |
This file contains hidden or 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
/** | |
* You must make the anchor tag display block or even inline-block if you want to get fancy. Without | |
* this, the anchor tag will always have demensions 0x0 no matter what you put in it. | |
*/ | |
a.some-link-button { | |
display: block; | |
} | |
.button { | |
width: 300px; | |
height: 50px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment