gpt4 book ai didi

css - Bootstrap - 为什么我的按钮没有响应?

转载 作者:行者123 更新时间:2023-11-28 11:26:16 24 4
gpt4 key购买 nike

正如您在下面的屏幕截图中看到的,我的粉红色按钮没有完全响应:低于特定宽度时,它会被剪切而不是调整大小以保持在视口(viewport)宽度内。问题是什么?非常感谢

enter image description here

.btn {
background-color: #ff00bf;
border: 0 none;
border-radius: 25px;
box-shadow: 0 11px 22px rgba(34, 34, 34, 0.2);
color: #fff;
display: inline-block;
font-size: 1rem;
letter-spacing: 0.025em;
padding: 1.1em 2.28em 1em;
text-decoration: none;
transition: all 0.3s ease-out 0s;
}
.btn {
-moz-user-select: none;
background-image: none;
border: 1px solid transparent;
border-radius: 4px;
cursor: pointer;
display: inline-block;
font-size: 14px;
font-weight: normal;
line-height: 1.42857;
margin-bottom: 0;
padding: 6px 12px;
text-align: center;
touch-action: manipulation;
vertical-align: middle;
white-space: nowrap;
}

最佳答案

white-space: nowrap 使得换行变得不可能。只需将其删除。此外,我会将最大宽度设置为 100%。

.btn {
background-color: #ff00bf;
border: 0 none;
border-radius: 25px;
box-shadow: 0 11px 22px rgba(34, 34, 34, 0.2);
color: #fff;
display: inline-block;
font-size: 1rem;
letter-spacing: 0.025em;
padding: 1.1em 2.28em 1em;
text-decoration: none;
transition: all 0.3s ease-out 0s;
}
.btn {
-moz-user-select: none;
background-image: none;
border: 1px solid transparent;
border-radius: 4px;
cursor: pointer;
display: inline-block;
font-size: 14px;
font-weight: normal;
line-height: 1.42857;
margin-bottom: 0;
padding: 6px 12px;
text-align: center;
touch-action: manipulation;
vertical-align: middle;
max-width: 100%;
}

关于css - Bootstrap - 为什么我的按钮没有响应?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45532261/

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