gpt4 book ai didi

html - @media 上的文本输入没有改变

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

我尝试使用此 UI 输入,但在我使用媒体查询时它没有任何改变。

当我尝试另一个 UI 时,它可以工作,但不适用于这个。

................................................ ..................................................... ..................................................... ............

我的代码有什么问题?

.centered 
{
width: 50%;
margin: auto;
}

.group {
width: 100%;
overflow: hidden;
position: relative;
}

.label {
position: absolute;
top: 40px;
color: #666666;
font: 400 26px Roboto;
cursor: text;
transition: 0.3s ease;
width: 100%;
text-align: center;
}

.input {
display: block;
width: 100%;
padding-top: 36px;
border: none;
border-radius: 0;
font-size: 30px;
transition: .3s ease;
text-align: center;
}
.input:valid ~ .label {
top: 3px;
font: 400 26px Roboto;
}
.input:focus {
outline: none;
}
.input:focus ~ .label {
top: 3px;
font: 400 26px Roboto;
}
.input:focus ~ .bar:before {
transform: translateX(0);
}
.bar {
border-bottom: 2px solid #ff5126;
width: 100%;
margin-top: 6px;
transition: .3s ease;
}
.input:valid ~ .bar
{
border-bottom: 2px solid #3bb873;
}
@media screen and (max-width: 1000px)
{
#centered-email
{
width: 100%;
}

}
        <div class="centered">
<div class="group">
<input type="text" class="input name" id="name" required autocomplete="off"/>
<label class="label name-l" for="name">ایمیل</label>
<div class="bar"></div>
</div>
</div>

最佳答案

id -> centered-email 没有元素。

更改为完成-

在您的媒体查询中将 #centered-email 替换为 .centered 将解决您当前的问题。

固定片段-

.centered {
width: 50%;
margin: auto;
}

.group {
width: 100%;
overflow: hidden;
position: relative;
}

.label {
position: absolute;
top: 40px;
color: #666666;
font: 400 26px Roboto;
cursor: text;
transition: 0.3s ease;
width: 100%;
text-align: center;
}

.input {
display: block;
width: 100%;
padding-top: 36px;
border: none;
border-radius: 0;
font-size: 30px;
transition: .3s ease;
text-align: center;
}

.input:valid~.label {
top: 3px;
font: 400 26px Roboto;
}

.input:focus {
outline: none;
}

.input:focus~.label {
top: 3px;
font: 400 26px Roboto;
}

.input:focus~.bar:before {
transform: translateX(0);
}

.bar {
border-bottom: 2px solid #ff5126;
width: 100%;
margin-top: 6px;
transition: .3s ease;
}

.input:valid~.bar {
border-bottom: 2px solid #3bb873;
}

@media screen and (max-width: 1000px) {
.centered {
width: 100%;
}
}
<div class="centered">
<div class="group">
<input type="text" class="input name" id="name" required autocomplete="off" />
<label class="label name-l" for="name">ایمیل</label>
<div class="bar"></div>
</div>
</div>

关于html - @media 上的文本输入没有改变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52137842/

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