文本区域正在自动获取内联样式

text area is getting inline styles automatically

本文关键字:获取 样式 区域 文本      更新时间:2023-09-26

我想给表单中的文本区域一个自定义宽度,但文本区域会自动获得内联样式,这会超过我的自定义css样式??我查看了我的脚本,但我不知道是哪一个在操纵dom???如果你知道的话,请告诉我。

这是我的标记头

<head>
<title>Demo Website</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,800' rel='stylesheet' type='text/css'>
<link href="//fonts.googleapis.com/css?family=PT+Sans:400,700" rel="stylesheet" type="text/css">
<link href='https://fonts.googleapis.com/css?family=Paytone+One' rel='stylesheet' type='text/css'>
<link href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.0/animate.min.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/jquery-ui.min.css">
<link rel="stylesheet" href="css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>

这些是我身体底部的唯一脚本

<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="js/jquery-ui.min.js"></script>
<script src="js/app.js"></script>

顺便说一句,这是我创建的第一个页面,也是唯一一个,所以我没有任何其他页面有文本区域字段。我的文本编辑器是括号,所以你知道。。

以下是它在开发工具中的呈现方式

<textarea data-brackets-id="173" name="textarea" id="textarea" placeholder="MESSAGE" style="margin: 0px;width: 183px;height: 54px;"></textarea>

虽然没有包含CSS代码,但我猜您在其中声明了关于<textarea>标记的一些内容。您可能需要查找在css代码后面声明的!important

它在移动设备和桌面上都能做到这一点吗?检查表单元素的宽度,使边距宽度为183px。