Garzon pro asked 6 years ago


Hello,I tried to setup a Carousel Image inside a <a> HTML tag as a link to open a new window. However it seems there is something which does not allow to do that.What is the properly way to do this? <div class=\\\"carousel-item\\\"><div class=\\\"view\\\"><a href=\\\"anyurl\\\" target=\\\"_blank\\\"><img class=\\\"d-block w-100\\\" src=\\\"xxxx\\\" alt=\\\"xxx\\\"></a><div class=\\\"mask rgba-black-light\\\"></div></div><div class=\\\"carousel-caption\\\"><p class=\\\"label-slider text-center\\\">  xxx </p></div></div>Thanks

Garzon pro answered 6 years ago


Hello,

It didn't work, however this code snippet was inside of the class "view", so the solution was use the tag <a> outside of <div class="view">

Thanks a lot.

C


Michal Szymanski staff answered 6 years ago


Hi,
try this code:

                <!--First slide-->
                <div class="carousel-item">
                    <a href="https://mdbootstrap.com/" target="_blank">
                        <img class="d-block w-100" src="https://mdbootstrap.com/img/Photos/Slides/img%20(130).jpg" alt="First slide">
                    </a>
                </div>
                


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags