画像にハイパーリンクしたいのですが、画像にhref
タグを追加するにはどうすればよいですか?画像をハイパーリンクする方法
<div class="laptop">
<img class='report' src="http://testtest/Report1.png"/>
レポートが表示されたら、それをクリックしてサイトに移動できます。
h1{
font-family: Arial Rounded MT Bold;
font-size: 33px;
color: #0F4194;
float: left;
margin: 50px 0px 15px 700px;
}
.laptop{
width:1024px;
height:661px;
float: center;
margin-right: -150px;
background: url('http://mlamannadev.com/Images/Laptop2.png');
background-repeat: no-repeat;
background-position: top left;
background-size: contain;
width: 1024px;
z-index:4;
}
.report{
position:absolute;
animation:round 16s infinite;
opacity:0;
z-index:-1;
margin-left: auto;
margin-right: auto;
display: block;
}
@keyframes round{
25%{opacity:1;}
40%{opacity:0;}
}
img:nth-child(4){animation-delay:0s;}
img:nth-child(3){animation-delay:4s;}
img:nth-child(2){animation-delay:8s;}
img:nth-child(1){animation-delay:12s;}
<!DOCTYPE html>
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<h1><center>Service Driven, Customer-Centric Solutions,
<br>
Empowered by Innovation.</center></h1>
<div class="laptop">
<img class='report' src="http://mlamannadev.com/Images/Report1.png"/>
<img class='report' src="http://mlamannadev.com/Images/Report2.png"/>
<img class='report' src="http://mlamannadev.com/Images/Report3.png"/>
<img class='report' src="http://mlamannadev.com/Images/Report2.png"/>
</div>
</body>
</html>
imgタグをアンカータグの内側に置き、hrefをアンカーに配置します。 '
' –
csmckelvey
リンク内に画像を置くには、https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_link_image – Carlton
をチェックしてください。StackOverflow、mlamannaへようこそ!将来的には、すでに試したコードのサンプルを提供し、どのような結果を得ているかによって、最良の結果が得られます。 – DWRoelands