css - 为什么修改textarea的text-align:center;在chrome中显示不正常,而在其他浏览器显示正常?
PHP中文网
PHP中文网 2017-04-17 13:22:06
[HTML讨论组]

为什么修改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;}
.p1{width:200px;height:200px;background-color: aqua;margin: 0 auto;}
</style>
</head>
<body>
<p ><textarea  title="leaveMessage" Class="formInput"  name="leaveWords"></textarea>
<br>
<button class="formButton">    留言</button>
<p class="p1"><p>you need cry dear</p></p>
</p>
</body>

在火狐是这样的

在chrome却是这样的

其他浏览器都是正常的或者差异不明显的

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

PHP中文网
PHP中文网

认证0级讲师

全部回复(1)
迷茫

textarea默认自带padding和border

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号