5

Hello i am new in the semantic world and I want to customize the default input height and width I know that we have predefined classes in semantic like small, big, mini but I need to have custom height and width.

In semantic documentation (http://semantic-ui.com/elements/input.html) at the input section we have this message:

"Inputs will automatically size themselves unless you manually declare a width"

I have declared the width in the input like this:

<input  width="10" type="text" value="test" placeholder="empty" readonly>

but it doesn't work for me. A little help please.

0

4 Answers 4

8

Note: The width attribute is used only with <input type="image">. http://www.w3schools.com/tags/att_input_width.asp

That's why your code doesn't work. To make it work, you can do this:

<input style="width:100px; height: 100px;" type="text" value="test" placeholder="empty" readonly>

Or use a CSS file:

input[type="text"] {
    width: 100px;
    height: 100px;
}

You can change 100px to the width and height you want. Semantic UI won't set width and height for you, that's why they say manually declare a width.

Sign up to request clarification or add additional context in comments.

Comments

2

I tried successfully:

style={{minWidth:"10em"}}

for

<Form.Field width={3}><Select placeholder='Options' options={options} 
    style={{minWidth:"10em"}}/></Form.Field>

Comments

2

You can set with for Semantic UI component using the style property.

It expects following syntax:

<Input style={{marginRight: spacing  'em'}}

In your example you should specify:

<Input style={{width: 100, height: 100}}

Comments

1

You would just put it in a custom css file

input[type="text"]{
height: 100px;
width: 400px;
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.