Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] CSS Logo HREF LINK Reply To: [Solved] CSS Logo HREF LINK

#187159
Paulie_D
Member

You can’t ‘link’ a background image.

This is your structure


  <a href="#">
    <div class="logo"></div>
  </a>

The only thing in the link IS the div so naturally, the div links.

You could do this


    <div class="logo">
      <a href="#"> </a>
    </div>

and use the image as a background of the link but you would have to define a size for the link in your CSS

OR…you could do this


    <div class="logo">
      <a href="#">
        <img src="whatever" alt="" />
      </a>
    </div>

and put the actual image in the HTML.

It’s up to you….any variety of the above including just


      <a href="#" class="logo">
        <img src="whatever" alt="" />
      </a>

works too.