<a href=""><img src=""><span>content</span></a>
ここで、画像にカーソルを合わせると、span タグで position relative to display none と position absolute を使用してスパン コンテンツが表示されます。さて、私の質問は、画像にカーソルを合わせているときに、トランジション効果が必要です。そのために、cssとは何ですか。私を助けてください。
<a href=""><img src=""><span>content</span></a>
ここで、画像にカーソルを合わせると、span タグで position relative to display none と position absolute を使用してスパン コンテンツが表示されます。さて、私の質問は、画像にカーソルを合わせているときに、トランジション効果が必要です。そのために、cssとは何ですか。私を助けてください。
プロパティを使用する必要があるために必要な要素display: none;
を通過することはできません...display: block;
opacity
.example1 {
border: 1px solid #f00;
height: 30px;
}
.example1 span {
opacity: 0;
-webkit-transition: all 1s;
-moz-transition: all 1s;
transition: all 1s;
}
.example1:hover span {
opacity: 1;
}
a.tip2 {
position: relative;
text-decoration: none;
}
a.tip2 span {display: none;
opacity: 0;
-webkit-transition: all 1s;
-moz-transition: all 1s;
transition: all 1s;
}
a.tip2:hover span {
display: block;
position: absolute;
padding: .5em;
content: attr(title);
min-width: 120px;
text-align: center;
width: 162px;
height:auto;
top: -247px;
left: 70px;
background: rgba(0,0,0,.8);
-moz-border-radius:10px;
-webkit-border-radius:10px;
border-radius:10px;
color: #fff;
font-size: .86em;
opacity: 1;
}
a.tip2:hover span:after {
position: absolute;
display: block;
content: "";
border-color: rgba(0,0,0,.8) transparent transparent transparent;
border-style: solid;
border-width: 10px;
height:0;
width:0;
position:absolute;
bottom: -16px;
left:1em;
}
これは私の css ですが、実際には 1 つのことを言うのを忘れています。これは純粋な css を使用したツール ヒントです。