我有两个不同的问题。第一个真的很刺激。我试图将文本与第一个框内的图像对齐,以便它们以并排方式并排排列。我不知道我做错了什么,我不想使用浮动。悬停时的图像转换
其次,我试图在悬停的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