gpt4 book ai didi

css - 当我缩小窗口时,字母从按钮上被截断

转载 作者:太空宇宙 更新时间:2023-11-04 01:33:08 25 4
gpt4 key购买 nike

每当我缩小窗口时,我的按钮上的字母就会被截断。我不确定如何实现解决方案。我已经提供了 css 和 html。我还提供了图片以便更好地理解。我知道我必须在 css 中更改或添加一些内容,但我不确定是什么。

我不确定如何实现解决方案。我已经提供了 css 和 html。我还提供了图片以便更好地理解。

enter image description here

.button {
display: inline-block;
position: relative;
cursor: pointer;
outline: none;
white-space: nowrap;
// margin: 5px;
padding: 0 22px;
font-size: 14px;
font-family: 'Roboto', sans-serif, 'Lato';
height: 40px;
width: 220px;
line-height: 40px;
background-color: #428bca;
color: #FFF;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 1px;
border: none;
text-shadow: 1px 1px 1px rgba(0,0,0,0.2);
margin: 0 auto;
text-align: center;

}
.panel-title {
margin-top: 0;
margin-bottom: 0;
font-size: 16px;
color: #ffffff;
}

.panel-heading {

color: #428bca;
background-color: #428bca;
border-top: 1px solid #dddddd;
border-left: 1px solid #dddddd;
border-right: 1px solid #dddddd;
//border-top-right-radius: 3px;
//border-top-left-radius: 3px;
}

.panel-body {
padding: 15px;
border: 1px solid #dddddd;
}
.nobottommargin {
margin-bottom: 0 !important;
}
.leftmargin-sm {
margin-left: 30px !important;
}

.button.button-rounded {
border-radius: 3px;
}

.button.button-reveal {
padding: 0 28px;
overflow: hidden;
}

.button.button-large {
padding: 0 26px;
font-size: 16px;
height: 46px;
line-height: 46px;
}

.button-teal {
background-color: #428bca;
}

/*code for the icon */
.button-reveal i {
position: absolute;
width: 2em;
height: 100%;
line-height: 45px;
background-color: rgba(0, 0, 0, .2);
text-align: center;
left: -100%;
transition: left 0.25s ease;
}
.button-reveal:hover i {
left: 0;
}
/* code for the letters*/
.button-reveal span {
display: inline-block;
margin: 0 2em;
transition: margin 0.35s ease;
}
.button-reveal:hover span {
margin: 0 1em 0 3em;
}
<div class="panel-heading">
<h2 class="panel-title">Access This Service</h2>
</div>

<div class="panel-body">
<!-- angular -->

<div ng-if="c.html" ng-bind-html="c.html"></div>

<a href="http://zoom.us" class="button button-rounded button-reveal button-large button-teal"><i class="fa fa-forward" aria-hidden="true"></i>
<span>Go there now!</span></a><br>

Note: If you haven’t accessed Zoom before, create a new account at <a href="http://zoom.us">zoom.us</a>.
</div>

enter image description here

最佳答案

只需将 min-width 添加到您的按钮即可

.button {
display: inline-block;
position: relative;
cursor: pointer;
outline: none;
white-space: nowrap;
// margin: 5px;
padding: 0 22px;
font-size: 14px;
font-family: 'Roboto', sans-serif, 'Lato';
height: 40px;
width: 220px;
line-height: 40px;
background-color: #428bca;
color: #FFF;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 1px;
border: none;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
margin: 0 auto;
text-align: center;
}

.panel-title {
margin-top: 0;
margin-bottom: 0;
font-size: 16px;
color: #ffffff;
}

.panel-heading {
color: #428bca;
background-color: #428bca;
border-top: 1px solid #dddddd;
border-left: 1px solid #dddddd;
border-right: 1px solid #dddddd;
//border-top-right-radius: 3px;
//border-top-left-radius: 3px;
}

.panel-body {
padding: 15px;
border: 1px solid #dddddd;
}

.nobottommargin {
margin-bottom: 0 !important;
}

.leftmargin-sm {
margin-left: 30px !important;
}

.button.button-rounded {
border-radius: 3px;
}

.button.button-reveal {
padding: 0 28px;
overflow: hidden;
}

.button.button-large {
padding: 0 26px;
font-size: 16px;
height: 46px;
line-height: 46px;
}

.button-teal {
background-color: #428bca;
}


/*code for the icon */

.button-reveal i {
position: absolute;
min-width: 2em;
height: 100%;
line-height: 45px;
background-color: rgba(0, 0, 0, .2);
text-align: center;
left: -100%;
transition: left 0.25s ease;
}

.button-reveal:hover i {
left: 0;
}


/* code for the letters*/

.button-reveal span {
display: inline-block;
margin: 0 2em;
transition: margin 0.35s ease;
}

.button-reveal:hover span {
margin: 0 1em 0 3em;
}
<div class="panel-heading">
<h2 class="panel-title">Access This Service</h2>
</div>

<div class="panel-body">
<!-- angular -->

<div ng-if="c.html" ng-bind-html="c.html"></div>

<a href="http://zoom.us" class="button button-rounded button-reveal button-large button-teal"><i class="fa fa-forward" aria-hidden="true"></i>
<span>Go there now!</span></a><br> Note: If you haven’t accessed Zoom before, create a new account at <a href="http://zoom.us">zoom.us</a>.
</div>

关于css - 当我缩小窗口时,字母从按钮上被截断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46719371/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com