0

What is the correct way to make the total area of a div a link?

I have multiple div's that are small tiles and I want the total area of the div to be a link.

Should the Anchor tag wrap a span on the inside or what is the best way to do this?

<div class="l-box">
    <h3>Service 1</h3>
    <p>Service description</p>
</div>
<div class="l-box">
    <h3>Service 2</h3>
    <p>Service description<</p>
</div>
ojhawkins
  • 3,200
  • 15
  • 50
  • 67
  • 2
    not everyone loves this practice , but try to wrap whole `div` with `a`. the problem is that `a` is inline element and `div` is block element – Ivan Chernykh Jul 22 '13 at 08:15

1 Answers1

3

Wrap your div with <a href="#"></a> and give display: block; to a

Bhojendra Rauniyar
  • 83,432
  • 35
  • 168
  • 231