Wachburn
Wachburn

Reputation: 2939

flexible elements in div element

I have this code

            <div class="search-box-wrapper">                
                <div class="search-box">
                    <span class="search-lbl">Search</span>
                    <span><input type="submit" name="search" value="Find" class="search-btn" /></span>
                    <span><input class="search-text" type="text" name="lookingfor" value=" " /></span>                        
                </div>                
        </div>

how can I make {input type="text"} element with flexible size? I mean search-lbl and search-btn will be around type="text" element, but search-text can change it's size.

Upvotes: 1

Views: 351

Answers (2)

Wez
Wez

Reputation: 10712

Try

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

However this might not be compatible with all browsers - I may have also missunderstoond @ckarlss0n may be right with text-area.

Upvotes: 1

ckarlss0n
ckarlss0n

Reputation: 23

Aren't you able to give it a width and a height in CSS?

.search-text{ width: 100px; height: 100px; }>

Maybe I misunderstood you. For a flexible text input element, check out text-area!

Upvotes: 1

Related Questions