0

I am trying to get my whole div a clickable link but I am not sure the correct way to do it. Would anyone be able to help me with this, it would be greatly appreciated. I am new to coding so I am still learning proper coding. Thanks.

.container {
  display: flex;
  margin: auto;
  width: 1052px;
}

.container>div {
  background-color: #ffffff;
  border: 1px solid #aaaaaa;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  flex: 1;
  /*grow*/
  height: 210px;
  margin: 45px 10px 0px 10px;
  width: 231px;
}

.container img {
  height: 140px;
  width: 241px;
}

.container>div a {
  color: #353748;
  display: block;
  font-family: Netflix Sans, Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  padding: 5px 10px 5px 10px;
  text-decoration: none;
  text-overflow: ellipsis;
  text-transform: initial;
}

.container>div a:hover {
  color: #353748;
  display: block;
  font-family: Netflix Sans, Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  padding: 5px 10px 5px 10px;
  text-decoration: underline;
  text-overflow: ellipsis;
  text-transform: initial;
}
<div class="container">
  <div>
    <img src="https://capebretonstartpage.com/1/wire-31023566-1595346165-638_636x382.jpg">
    <a href="https://www.capebretonstartpage.com/pages/about/" target="_blank">About vAdd An Image Add An Image</a>
  </div>
  <div>
    <img src="https://capebretonstartpage.com/1/wire-31023566-1595346165-638_636x382.jpg">
    <a href="https://www.capebretonstartpage.com/pages/about/" target="_blank">About vAdd An Image Add An Image</a>
  </div>
  <div>
    <img src="https://capebretonstartpage.com/1/wire-31023566-1595346165-638_636x382.jpg">
    <a href="https://www.capebretonstartpage.com/pages/about/" target="_blank">About vAdd An Image Add An Image</a>
  </div>

</div>
mplungjan
  • 169,008
  • 28
  • 173
  • 236

1 Answers1

-1

You can put the div inside an <a> tag

Kiyubi
  • 57
  • 8