Engine
Engine

Reputation: 5422

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 :

`<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

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 :

label

the label should show at the least enough please for 6 digits which's not the case ! 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

Upvotes: 0

Views: 75

Answers (4)

NULL
NULL

Reputation: 1858

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. Example

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

Upvotes: 1

Lalit Sachdeva
Lalit Sachdeva

Reputation: 6619

<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

Upvotes: 1

vivek
vivek

Reputation: 2004

I think you are trying to add some style to the label for that you've to specify it in style property:

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

Upvotes: 1

Liglo App
Liglo App

Reputation: 3819

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.

Otherwise, what is the problem with the size`?

Upvotes: 1

Related Questions