开发者

fullscreen textarea without scrollbars

I have a textarea开发者_JAVA技巧 that I want to fill up the entire screen. Everyway I try it goes enough beyond the screen to need scrollbars.

I'm doing this to fill it up:

$('textarea').width($(window).width()).height($(window).height());

If you check out this demo you can see that it goes too far and that it then needs scrollbars. Is there a way to have it fill up the entire screen and not need scrollbars?


Nothing to do with javascript, you just did not noticed, pre-defined browser defaults for elements. Use this in your CSS stylesheet:

textarea { border: none; }
body { padding: 0; }


Use add some css.

body { margin: 0; padding: 0; overflow: hidden; }
textarea { border: 0; }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜