Hyperlink spreading across the width of the page

I have an image I want linked, but when I link it, the link goes across the whole span of the page. I saw another post about this, but changing the width and height don’t seem to do anything for me.

.banner {
    width:88px 
    height:31px
}
<div style= "position:relative; top:100px">
  <div class="banner">
    <a href="https://liminal.photos"><img src="https://liminal.photos/liminalbanner.jpg"></a>
  </div>
  <p>click the banner above if the music doesn't play</p>
  <div align="center">
    <textarea readonly>
      <a href="https://liminal.photos"><img src="https://liminal.photos/liminalbanner.jpg"></a>
    </textarea>
</div>

>Solution :

You’re missing a semicolon at the end of the first line of CSS.

You need to target the size of the image instead of the banner.

.banner, .banner img {
    width: 88px;
    height: 31px;
}

Make the anchor tag a block level element as well:

.banner a {
    display: block;
}

Leave a Reply