<input> is the full width

0 like 0 dislike
4 views
There is such code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">Testbody > div {clear:both;overflow:hidden;width:400px;}body > div * {float:left;}Floating sizeFixed sizeReally floating sizeFixed size


You need to make the entire available width of the parent diva.
by | 4 views

5 Answers

0 like 0 dislike
If you do not confuse shoals in ie<8:
\r
\r
<!</font>DOCTYPE html>
\r<html>
\rthe <head>
\r <title>Test</title>
\r <style type='text/css'>
body > div {
width:400px;
}
.row {
display:table-row;
}
.row input[type=text]{
width:100%;
}
.row div:first-child {
display:table-cell; white-space:nowrap;
}
.row div:nth-child(2){
display:table-cell;
width:100%;
padding-right:4px;
}
.row div:nth-child(3){
width:40px;
}
\r </style>
\r</head>
\rthe <body>
\rthe <div>
\r <div class='row'>
\r the <div>Floating size</div>
\r the <div>
\r <input type='text'/>
\r </div>
\r the <div>40px;</div>
\r </div>
\r</div>
\rthe <div>
\r <div class='row'>
\r the <div>Really Floating size</div>
\r the <div>
\r <input type='text'/>
\r </div>
\r the <div>40px;</div>
\r </div>
\r</div>
\r</body>
\r</html>

\r
\r* This source code was highlighted with Source Code Highlighter.

\r
\rimage
by
0 like 0 dislike
by
0 like 0 dislike
.text { padding-left: 6px; }
.text input { width: 100%; }
\r
Default border of input from both sides — 6 PKS. There still is a feature for input in this parent { float: left; overflow: hidden; } is there for IE6-7, for the situation with tables.
by
0 like 0 dislike
This is one of the few exceptions where it is appropriate to "improper" use of tables.
The variant with divas and CSS antics, of course, also possible — but anyway, he will not be 100% reliable and compatible. And the piercing table.
by
0 like 0 dislike
The usual "width:100%;" does not solve the problem?
by

Related questions

0 like 0 dislike
7 answers
0 like 0 dislike
2 answers
asked May 22, 2019 by Alex1237
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
28,757 users