简体   繁体   English

HTML中的输入字段大小

[英]the input field size in HTML

I'm new to HTML, I have a part of code that generate a label, it works fine but I do habe a problem with the label size, <label for="voltage-amount;">V</label> I tried to use display:inline-block like : 我是HTML的新手,我有一部分代码可以生成标签,它可以正常工作,但是我确实遇到了标签大小问题,我尝试了<label for="voltage-amount;">V</label>使用display:inline-block如:

`<label for="voltage-amount;"display:inline-block>V</label>`   

but it didn't change anything, here is the code that I'm working on: 但它没有任何改变,这是我正在处理的代码:

    <div id="voltage-box" class="box">
    <p>voltage limit:</p>
    <input name="aoutu" type="text" id="voltage-amount"  class="slicknumber" value="<%= format("%0.3f",channel.valueor 0)%>"/>
    <label for="voltage-amount;">V</label><div id="voltage"></div>
</div>

an idea how can I do this, thanks ! 一个想法,我该怎么做,谢谢!

UPDATE UPDATE

thanks for your helps here is what I've done now : 感谢您的帮助,这是我现在所做的:

    <div id="voltage-box" class="box">
    <p>voltage limit:</p>
    <input name="aoutu" type="text" id="voltage-amount"  class="slicknumber" value="<%= format("%0.3f",channel.aoutu or 0)%>"/>
    <label for="voltage-amount" style="display:inline-block">V</label> <div id="voltage"></div>
</div>

and I still don't get a "bigger" size of the label : 而且我仍然没有得到“更大”的标签尺寸:

标签

the label should show at the least enough please for 6 digits which's not the case ! 标签上至少应显示至少6位数字,实际情况并非如此! did I do something wrong here ? 我在这里做错什么了吗?

**2nd Update ** **第二次更新**

the code looks like : 代码如下:

<input name="aoutu" type="text" id="voltage-amount"  class="slicknumber" style="display: inline-block; width: 300px" value="<%= format("%0.3f",channel.aoutu or 0)%>"/>

and still no change! 还是没有变化! thanks again your help 再次感谢您的帮助

Multiple issues here: 这里有多个问题:

<label for="voltage-amount" style="display:inline-block">V</label>   

Remove the ; 删除; character in the for attribute and wrap the display directive into a style attribute if you want it to work. 字符中的for属性,并将display指令包装为style属性(如果您希望它起作用)。

Otherwise, what is the problem with the size`? 否则,尺寸有什么问题?

我认为您正在尝试为标签添加一些样式,以便您在style属性中指定它:

<label for="voltage-amount" style="display:inline-block">V</label>
<label for="voltage-amount;"display:inline-block>V</label>

this is wrong use of inline styles 这是内联样式的错误使用

<label for="voltage-amount;" style="display:inline-block">V</label>

and if you wants to work on font size do something like this 如果您要处理字体大小,请执行以下操作

<label for="voltage-amount;" style="display:inline-block; font-size: 30px">V</label>

or any size that you wants 或您想要的任何尺寸

I think you wanted this one... 我想你想要这个...

<input name="aoutu" type="text" id="voltage-amount"  class="slicknumber" style="display:inline-block" value="<%= format("%0.3f",channel.aoutu or 0)%>"/>

If this is not satisfactory then you can add CSS width to expand it more. 如果这不令人满意,则可以添加CSS width以进一步扩展它。 Example

style="display: inline-block; width: 30px"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM