gpt4 book ai didi

html - 响应元素

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

我有以下代码,我试图让所有相邻的元素在窗口大小时改变时响应。我不介意它们变小,只要它们彼此相邻即可。我的想法是使用媒体查询,但在那个领域不是很成功。

HTML:

<div  style="float:left">
<div >Testing Responsivness</div>
</div>
<div style="float:left">
<input type="number" class="theInput" min="1" />
<label ><strong class="q-d-currency">&nbsp; $ </strong> </label>
</div>
<div >
<button type="submit" ></button>
</div>

https://jsfiddle.net/rft1y94v/

最佳答案

看看这个 fiddle ......这是你想要的吗?

Fiddle

HTML:

    <div class="block1">
<div style="display:inline-block;" >Testing Responsivness</div>
</div>
<div class="block2">
<input type="number" class="theInput" min="1" />
<label ><strong class="q-d-currency">&nbsp; $ </strong> </label>
</div>
<div class="block3">
<button type="submit" >submit</button>
</div>

CSS

.block1{
width:33%;
display:inline-block;
float:left;
word-break: break-all;
}

.block2{
width:33%;
display:inline-block;
float:left;
}

.block3{
width:33%;
display:inline-block;
float:left;
}

关于html - 响应元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33546838/

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