Why isn't this anchor tag taking up 100% of the available space of its parent div?

anchor, css, html

Solution

I believe its because the block element has no content inside of it. If you add a letter inside the anchor link the anchor link will become 100% of the width of the div.

If you add width:100% and height:100% it will take up the entire div.

Problem

My understanding leads me to believe that putting a `<a>` with the `display:block;` CSS property inside of a `<div>` is supposed to cause that entire div to "become" the link (IE anywhere I hover in the div, it is considered the link, because the link takes up 100% height and width). That behavior doesn't seem to be working in the example below. If you'd rather `inspect element` and poke around yourself with the live code, you can view the site @: http://shayla.phasesolutions.ca/. See the nav at the top of the page for the issue I'm describing. HTML: ``` <header> <div class="logo"><a href="#"></a></div> <div class="nav-homepage"><a href="#"></a></div> <div class="nav-webdesign"><a href="#"></a></div> <div class="nav-graphicdesign"><a href="#"></a></div> <div class="nav-miscartwork"><a href="#"></a></div> <div class="nav-aboutme"><a href="#"></a></div> <div class="nav-contactme"><a href="#"></a></div> </header> ``` CSS: ``` header { .site-section; height: 125px; div { float: left; position: relative; top: 10px; a { display: block; } } div:first-child { position: relative; top: 0px; } } .nav-aboutme, .nav-contactme, .nav-graphicdesign, .nav-homepage, .nav-miscartwork, .nav-webdesign, .shadow, .homepage-nav-aboutme, .homepage-nav-contactme, .homepage-nav-graphicdesign, .homepage-nav-miscartwork, .homepage-nav-webdesign, .logo{ background: url(/resource/img/sprites.png) no-repeat; } .nav-aboutme { background-position: -81px -361px ; width: 76px; height: 105px; margin-right: 49px; } .nav-contactme { background-position: 0 -360px ; width: 76px; height: 105px; } .nav-graphicdesign { background-position: -79px -246px ; width: 89px; height: 105px; margin-right: 49px; } .nav-homepage { background-position: 0 -245px ; width: 76px; height: 105px; margin-right: 49px; } .nav-miscartwork { background-position: -79px -132px ; width: 85px; height: 105px; margin-right: 49px; } .nav-webdesign { background-position: 0 -132px ; width: 76px; height: 105px; margin-right: 49px; } ```

Original source