I\'m trying to create a textarea
that looks exactly like a div
.
However, on iOS there\'s 3 pixels coming from somewhere that I can\'t remove.>
Okay... Sorry... Here we go... The officially unofficial answer is...
You can't get rid of it.
Apparently this is a "bug" with mobile safari on inputs. See:
You can, however, knowing the indent do this
textarea {
text-indent:-3px;
}
It's not a pretty solution, but it does what you need.
Edit Forgot to mention, tested with iOS Simulator. You might try on your phone itself.
Another point: This also assumes that you're serving up css solely for mobile safari, specifically for the iPhone. An older way of doing this is:
/* Main CSS here */
/* iPhone CSS */
@media screen and (max-device-width: 480px){
/* iPhone only CSS here */
textarea {
text-indent: -3px;
}
}
Edit Again I'm having way too much fun with this... You can also use separate stylesheets with these declarations:
Edit Because apparently somebody bought an Android ;)
Personally, I don't really have a problem with text-entries having some internal indentation. It clears it from the area's edge and makes it more readable. I do, however, believe that a browser should support the spec. So here's an update for differentiating between android and iPhone. Have fun!