0
How to set height and width of an anchor tag?
2 Respuestas
+ 9
Anchor (<a>) are inline elements. Inline elements can't have width and height. So if you want inline elements to maintain it's native property, i.e. be in the normal flow of line, and still have width, height and vertical-align properties.. then inline-block is the property you should be using.
More Reading and examples: http://www.stackoverflow.com/questions/15551184/how-to-assign-height-and-width-to-anchor-tag-link
List of inline elements in HTML: http://www.tutorialchip.com/tutorials/inline-elements-list-whats-new-in-html5/
0
css:
<style>
li {
width: 110px;
height: 42px;
background-color: black;
}
li a {
width: 32px;
height: 32px;
color: white;
}
</style>
html page:
<li><a href="#">write something</a></li>
you need to set anchor tag's display property as block :: 'display:block;' , then only it will accept values of height and width.