【发布时间】:2015-08-30 21:25:55
【问题描述】:
w3.org 验证器给我这个错误:
Line 322, Column 29: Element style is missing required attribute scoped.
<style type="text/css">
样式化我的 html 代码:
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<title>title</title>
</head>
<body>
<style type="text/css"></style>
<script type="text/javascript"></script>
</body>
</html>
对于 wordpress 中的重力形式插件。
<style type="text/css">
.gright,.gform_wrapper form ,.gform_wrapper ul li:before, .gform_wrapper ul li:after, .gform_wrapper ul.gform_fields {
text-align: right !important;
direction:rtl !important;
}
.gleft,.gform_wrapper input[type="url"], .gform_wrapper input[type="email"],
.gform_wrapper input[type="tel"], .gform_wrapper input[type="number"],
.gform_wrapper input[type="password"],body.rtl .gform_wrapper input[type="email"], body.rtl .gform_wrapper input[type="password"],
body.rtl .gform_wrapper input[type="url"], body.rtl .gform_wrapper input[type="tel"],body .gform_wrapper.gf_rtl_wrapper input[type="email"],
body .gform_wrapper.gf_rtl_wrapper input[type="password"], body .gform_wrapper.gf_rtl_wrapper input[type="url"], body .gform_wrapper.gf_rtl_wrapper input[type="tel"] {
text-align:left !important;
direction:ltr !important;
}
.gform_wrapper .ginput_complex .ginput_left {
float: right !important;
}
.gform_wrapper .ginput_complex .ginput_right {
float: left !important;
}
.gform_wrapper .gfield_checkbox li label,
.gform_wrapper .gfield_radio li label {
margin-right:20px !important;
}↩
.gform_wrapper .ginput_complex.ginput_container.has_first_name.has_middle_name.has_last_name span.name_first,
.gform_wrapper .ginput_complex.ginput_container.has_first_name.has_middle_name.has_last_name span.name_middle,
.gform_wrapper .ginput_complex.ginput_container.has_first_name.no_middle_name.has_last_name span.name_first{
margin-right:0px !important;
margin-left: 1.3% !important;
}
</style>
请帮我修复 html 或 wordpress 中的插件。
【问题讨论】:
-
缺少
</style>,<style>应该在<head>中 -
stackoverflow.com/questions/27539084 的副本? -> 要么按照 Alex K. 的建议将样式移到头部,要么使用 scoped 属性。
-
不 - 未修复 - 帮帮我
-
从 中移除
-
请注意,
<style>和<script>标签的type属性在 HTML5 中是无用的,除非您使用 CSS 和 javascript 之外的其他东西...
标签: html w3c-validation