Html 更正按钮中图标的位置,该按钮';它在悬停状态
我正在尝试设置悬停上的电子邮件按钮的动画。一切正常,除了邮件图标悬停在上方时会移到中心。它应该保持在文本的左侧,基本上处于起始位置。如果能得到任何帮助,我将不胜感激。这是我的代码笔和css的链接 代码笔: Css:Html 更正按钮中图标的位置,该按钮';它在悬停状态,html,css,Html,Css,我正在尝试设置悬停上的电子邮件按钮的动画。一切正常,除了邮件图标悬停在上方时会移到中心。它应该保持在文本的左侧,基本上处于起始位置。如果能得到任何帮助,我将不胜感激。这是我的代码笔和css的链接 代码笔: Css: 我对Itag的样式做了两个更改。请查收 * { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing:
我对
I
tag的样式做了两个更改。请查收
* {
margin: 0;
padding: 0;
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
html {
font-size: 10px;
font-family: 'Poppins', sans-serif;
color: #111111;
}
body {
width: 100%;
height: 100;
}
section {
padding: 6rem;
}
/*Start email icon*/
#container {
font-size: 1rem;
line-height: 1.5;
padding: .1% 10%;
}
#learn-more {
position: relative;
display: inline-block;
cursor: pointer;
outline: none;
border: 0;
vertical-align: middle;
text-decoration: none;
background: transparent;
padding: 0;
font-size: inherit;
font-family: inherit;
}
#learn-more {
width: 20rem;
height: auto;
}
#learn-more #circle {
-webkit-transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
position: relative;
margin: 0;
width: 4rem;
height: 4rem;
background: #dadada;
border-radius: 2.625rem;
}
#learn-more #circle #icon {
-webkit-transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
position: absolute;
background: #fff;
}
i {
color: #fff;
font-size: 2rem;
position: absolute;
display: block;
content: '';
top:25%;
left: 10px; //changed
//width: 50%; // removed
}
#learn-more #circle #icon#arrow {
-webkit-transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
background: none;
}
#learn-more #circle #icon#arrow::before {
position: absolute;
}
#learn-more #button-text {
-webkit-transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
padding: 0.75rem 1rem;
margin: 0 0 0 1.85rem;
color: #fff;
font-weight: 700;
font-size: 1.5rem;
line-height: 1.6;
text-align: center;
text-transform: uppercase;
vertical-align: center;
}
#learn-more:hover #circle {
width: 100%;
background: #000;
}
#learn-more:hover #circle #icon{
background: #fff;
-webkit-transform: translate(1rem, 0);
transform: translate(1rem, 0);
}
#learn-more:hover #button-text {
color: #fff;
}
/*End email icon*/
我对
I
tag的样式做了两个更改。请查收
* {
margin: 0;
padding: 0;
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
html {
font-size: 10px;
font-family: 'Poppins', sans-serif;
color: #111111;
}
body {
width: 100%;
height: 100;
}
section {
padding: 6rem;
}
/*Start email icon*/
#container {
font-size: 1rem;
line-height: 1.5;
padding: .1% 10%;
}
#learn-more {
position: relative;
display: inline-block;
cursor: pointer;
outline: none;
border: 0;
vertical-align: middle;
text-decoration: none;
background: transparent;
padding: 0;
font-size: inherit;
font-family: inherit;
}
#learn-more {
width: 20rem;
height: auto;
}
#learn-more #circle {
-webkit-transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
position: relative;
margin: 0;
width: 4rem;
height: 4rem;
background: #dadada;
border-radius: 2.625rem;
}
#learn-more #circle #icon {
-webkit-transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
position: absolute;
background: #fff;
}
i {
color: #fff;
font-size: 2rem;
position: absolute;
display: block;
content: '';
top:25%;
left: 10px; //changed
//width: 50%; // removed
}
#learn-more #circle #icon#arrow {
-webkit-transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
background: none;
}
#learn-more #circle #icon#arrow::before {
position: absolute;
}
#learn-more #button-text {
-webkit-transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
padding: 0.75rem 1rem;
margin: 0 0 0 1.85rem;
color: #fff;
font-weight: 700;
font-size: 1.5rem;
line-height: 1.6;
text-align: center;
text-transform: uppercase;
vertical-align: center;
}
#learn-more:hover #circle {
width: 100%;
background: #000;
}
#learn-more:hover #circle #icon{
background: #fff;
-webkit-transform: translate(1rem, 0);
transform: translate(1rem, 0);
}
#learn-more:hover #button-text {
color: #fff;
}
/*End email icon*/