Reputation: 6617
I have following input boxes.
I reduced their width to align them in-line and it looks good in full sized window,Now problem occurs when i do narrow screen.
It looks really bad while doing narrow screen.
A look-
I tried these input boxes to get a new line with setting up max-width
.
In code-
I am using input as-
For price Ex. Vat-
<input type="text" style="width:85%;max-width:85%;" id="Order" maxlength = "10" name="PriceExVat" onkeypress="validate(event)"/>
But it doesn't get a new line while doing narrow screen.
I want this desired responsive layout for these input blocks-
Upvotes: 1
Views: 9759
Reputation:
I think you have added display: inline;
try display: inline-block;
this may solve the problem.
Upvotes: 1
Reputation: 356
You are almost there. You must use min-width
for preventing elements from shrinking after a particular width.
Replace max-width
with min-width
in your-code and try again. Also you might want to specify max-width: nPixels px;
to prevent the text-boxes from occupying 85% width when on full screen.
Upvotes: 1
Reputation: 1889
Do a media query and make them block elements -
@media all and (max-width: 500px) and (min-width: 0px) {
input[type="text"] {
display:block;
}
}
Upvotes: 8