我有兩個不同的問題。第一個真的很刺激。我試圖將文本與第一個框內的圖像對齊,以便它們以並排方式並排排列。我不知道我做錯了什麼,我不想使用浮動。懸停時的圖像轉換
其次,我試圖在懸停的x軸上獲取圖像transform: translate
。事情是,我想transform
上的圖像.extra-box:hover
...不是在實際的圖像上,但我只希望圖像移動。我無法弄清楚這一點。
我在做什麼錯?
#extra {
\t margin: 25px auto;
\t width: 460px;
\t height: auto;
}
.extra-box {
\t position: relative;
\t width: 40%;
\t padding: 8px;
\t border-radius: 3px;
\t /*border: 1px solid #739BAF;*/
\t border: 2px solid black;
\t display: inline-block;
\t background: none;
\t transition: 0.5s ease;
}
.extra-box:hover {
\t border: 2px solid red;
\t transition: 0.5s ease;
}
.extra-box:first-child {
\t margin-left: 0;
\t width: 40%;
\t margin-right: 10%;
}
.extra-box:last-child {
\t width: 40%;
}
.extra-box a {
\t text-decoration: none;
}
.extra-box-text {
\t color: black;
\t font-size: 1em;
\t display: inline-block;
\t width: auto;
}
.extra-box-icon img {
\t padding-left: 5px;
\t width: 15px;
\t height: auto;
\t display: inline-block;
\t -webkit-transition: all .5 ease-in-out;
transition: all .5 ease-in-out;
\t /*transform: translateX(30px);
\t -webkit-transform: translateX(30px);*/
}
\t \t <div id="extra"><div class="extra-box">
\t \t \t \t <a href="contact">
\t \t \t \t \t <div class="extra-box-text">Need help?<br>Contact Us Now</div><div class="extra-box-icon"><img src="icons/right-arrow.png"></div>
\t \t \t \t </a>
\t \t \t </div><div class="extra-box">
\t \t \t \t <a href="register">
\t \t \t \t \t <div class="extra-box-text">Need an account?<br>Register Now</div>
\t \t \t \t </a>
\t \t \t </div>
\t \t </div>
移除填充左上.extra箱圖標IMG圖像對齊。 – super11