18910140161

HTML-字段集中出现未知CSS-堆栈溢出

顺晟科技

2022-10-18 12:28:37

196

我很难设计这个字段集。它似乎在挑选我没有放在上面的随机造型。Inpsect中显示了一个随机边距,它将标签推到新的一行。此外,它的中心对齐,我找不到任何代码告诉它这样做。

https://sidecoinc.com/contact/.

我已经附上了代码,但这似乎不是问题。

我试着让它看起来正常一点。旁边有标签并左对齐的复选框。

<代码><;字段设置=";MSM_自定义_兴趣<;图例>;您需要什么帮助?<;/legend>;<;输入类型=";复选框";类=";自定义_输入";name=";MSM_自定义_jameshardie";value=";true";>;James Hardie<;BR>;<;输入类型=";复选框";类=";自定义_输入";name=";MSM_自定义_MarvinWindowsDOORS";value=";true";>;Marvin Windows&;门<;BR>;<;输入类型=";复选框";类=";自定义_输入";name=";MSM_自定义_TimberTech";value=";true";>;Timbertech<;BR>;<;输入类型=";复选框";类=";自定义_输入";name=";MSM_自定义_湿度管理";value=";true";>;湿度管理信息<;BR>;<;输入类型=";复选框";类=";自定义_输入";name=";MSM_自定义_户外生活";value=";true";>;户外生活选择<;BR>;<;输入类型=";复选框";类=";自定义_输入";name=";MSM_自定义_一切";value=";true";>;一切<;BR>;<;输入类型=";复选框";类=";自定义_输入";NAME=";MSM_自定义_其它";value=";true";>;other<;BR>;<;/字段设置>;#MarketSharpMFIELDSET输入.自定义_输入{宽度:自动;高度:自动;}#MarketSharpMformDiv输入{边框间距:0px;边距:0px;填充:0px;空间:0px;显示:块;}#MarketSharpMFIELDSET输入{宽度:100%;高度:32px;}

顺晟科技:

问题是输入上的显示块-强制输入为全宽,因此标签被推到下一行。

将display:block-更改为 <fieldset for="MSM_custom_Interests"> <legend>What do you need help with?</legend> <input type="checkbox" class="custom_input" name="MSM_custom_JamesHardie" value="True">James Hardie<br> <input type="checkbox" class="custom_input" name="MSM_custom_MarvinWindowsDoors" value="True">Marvin Windows & Doors<br> <input type="checkbox" class="custom_input" name="MSM_custom_TimberTech" value="True">TimberTech<br> <input type="checkbox" class="custom_input" name="MSM_custom_MoistureManagement" value="True">Moisture Management info<br> <input type="checkbox" class="custom_input" name="MSM_custom_OutdoorLiving" value="True">Outdoor Living Options<br> <input type="checkbox" class="custom_input" name="MSM_custom_Everything" value="True">Everything<br> <input type="checkbox" class="custom_input" name="MSM_custom_Other" value="True">Other<br> </fieldset> #marketsharpmFieldSet input.custom_input { width: auto; height: auto; } #marketsharpmFormDiv input { border-spacing: 0px; margin: 0px; padding: 0px; space: 0px; display: block; } #marketsharpmFieldSet input { width: 100%; height: 32px; } ..请注意,这将把复选框和标签带到同一行-但您在内容居中的某个位置设置了样式,因此需要解决这个问题。我还建议在复选框的右边添加一个边距(或在标签的左边添加一个边距),将它们隔开一点。

display: inline-block
将block更改为inline-block的

效果:

enter image description here

  • TAG:
相关文章
我们已经准备好了,你呢?
2024我们与您携手共赢,为您的企业形象保驾护航