Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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 :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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;
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading