为什么修改textarea的text-align:center;在chrome中显示不正常,而在其他浏览器显示正常?

发布于 2022-09-02 19:51:23 字数 1320 浏览 17 评论 0

为什么修改textarea的text-align:center;在chrome中显示不正常,而在其他浏览器显示正常?

以下是代码

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<style>
html{margin:0 auto;text-align:center;}
body{max-width: 900px;margin:0 auto;}
textarea{width:200px;height: 200px;}
button {width: 200px;text-align: center;}
.div1{width:200px;height:200px;background-color: aqua;margin: 0 auto;}
</style>
</head>
<body>
<div ><textarea  title="leaveMessage" Class="formInput"  name="leaveWords"></textarea>
<br>
<button class="formButton">    留言</button>
<div class="div1"><p>you need cry dear</p></div>
</div>
</body>

在火狐是这样的
这是火狐浏览器
在chrome却是这样的
这是chrome
其他浏览器都是正常的或者差异不明显的
这是EDGE
这是IE

而且无论采取何种布局,textarea永远会多出一点点。
why?为什么会这样?是我的浏览器出问题 了吗?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

此生挚爱伱 2022-09-09 19:51:23

textarea默认自带padding和border

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文