CSS overflow:visible
doesn't seem to get applied to inputs.
See the following JS fiddle: https://jsfiddle.net/b4sr578j/
input {
border: 1px dashed black;
overflow: visible;
height: 28px;
font-size: 30px;
}
<input type='text' value='gggyyyXXX'/>
Is it possible to make the bottom of the gs and ys visible (without increasing the height of the text input)?
Thanks for any help.
Answer to the original question - As indicated already by Sebastian Hens, this is not possible. The reason is because
input
elements are replaced elements and the overflow property applies only to non-replaced elements.As already mentioned in comments, the ideal solution would be to make use of
contenteditable
elements because they do respect theoverflow
settings.Here is a workaround solution which uses multiple
linear-gradient
to generate the dashed border effect. Part of the answer is adopted from Danield's answer (the parts aboutpadding
and removal ofheight
). On top of it, I have modified theappearance
and added the gradients.Though we haven't added the height explicitly, the actual height of the area within the border would still be the same as that in your original code. I have added an input box with your original code on the left side for comparison. I don't know if that is acceptable for you. If you mandatorily want the
height
to be set then this would not work.In the above snippet a white
box-shadow
is used to hide the bottom part of the gradient so that it doesn't overflow (you can see the effect by removing thebox-shadow
) and because of this it needs a solid color background. On the other hand if the height of your text box is fixed then you could use something like the below snippet to even support non solid backgrounds.This approach is tested in Chrome, Firefox, Opera and IE11. Because gradients is supported in IE10, it should work fine there also but would not work with any of the lower versions as they don't support gradients.