HTML Checking for Large Sites
Rocket Validator automatically checks your pages on the W3C Validator.
The “font” element is obsolete. Use CSS instead.
The <font>
element, used to define the font face, size and color in previous versions of HTML, is no longer valid in HTML5. Instead, you should rely on CSS styles.
For example, you can define a font size of 12px, bold text with inline styles like this:
<p style="font-size: 12px; font-weight: bold;">some text</p>
Learn more about CSS fonts:
Related W3C validator issues
The <table>
element does not accept a height
attribute. Use CSS instead.
A CSS definition for background-image
could not be understood by the parser. Check its definition to ensure that it’s well formed and that it contains an appropriate value.
The value on the display
property is not valid.
The display CSS property sets whether an element is treated as a block or inline element and the layout used for its children, such as flow layout, grid or flex.
Learn more:
The specified CSS filter is not a standard one, and may only work in some browsers.
Check out the Filter Effects W3C Working Draft
font-display
isn’t a CSS property, it’s a descriptor for use with the @font-face
at-rule.
Learn more:
This issue is a false positive by the W3C validator, fixed in the latest versions of Nu Validator.
The value revert
is indeed a valid value for the CSS property font-size
.
Learn more:
The @import
CSS rule can be used to import a style sheet into another style sheet. It must appear at the top of the document, and after any @charset
declaration.
Learn more:
The max-width
CSS property sets the maximum width of an element. It prevents the used value of the width
property from becoming larger than the value specified by max-width
.
This property can express a value in different units like px
, em
, %
or ch
, and keyword values, but auto
is not an allowed value.
Some examples of valid values for max-width
:
/* <length> value */
max-width: 3.5em;
/* <percentage> value */
max-width: 75%;
/* Keyword values */
max-width: none;
max-width: max-content;
max-width: min-content;
max-width: fit-content(20em);
/* Global values */
max-width: inherit;
max-width: initial;
max-width: revert;
max-width: unset;
Learn more:
An invalid CSS property is being used. Properties starting with mso-
are commonly defined by Microsoft products like Office and Outlook.
These properties, like mso-spacerun
, mso-fareast-font-family
, mso-bidi-font-weight
, mso-margin-bottom-alt
, mso-margin-top-alt
and others starting with mso-
are not standard CSS properties.
Padding properties, unline margin properties, don’t accept negative values. Read more about the CSS box model
CSS styles could not be parsed, check the indicated line to find what caused the parser to fail. Common causes are unclosed curly brackets or comments, missing semicolons or unexpected or empty properties.
Read more about CSS: Cascading Style Sheets syntax
The value break-word
for the property word-break
is deprecated, you should replace it with a valid value.
According to the CSS Text Module Level 3 spec:
For compatibility with legacy content, the word-break property also supports a deprecated
break-word
keyword. When specified, this has the same effect asword-break: normal
andoverflow-wrap: anywhere
, regardless of the actual value of theoverflow-wrap
property.
Learn more:
The value specified for the transform
CSS attribute is not valid.
The transform
CSS property lets you rotate, scale, skew, or translate an element. It modifies the coordinate space of the CSS visual formatting model.
Learn more:
The ::file-selector-button
has not been recognized by the W3C Validator. This seems to be a bug in the W3C Validator, which has already been reported.
Learn more:
The value specified for a width
attribute in CSS is not valid.
The width CSS property sets an element’s width. There are many allowed values for this attribute, for example:
/* <length> values */
width: 300px;
width: 25em;
/* <percentage> value */
width: 75%;
/* Keyword values */
width: max-content;
width: min-content;
width: fit-content(20em);
width: auto;
/* Global values */
width: inherit;
width: initial;
width: revert;
width: unset;
Learn more:
CSS can’t be properly processed because a computed style is missing a value it depends on.
A CSS definition for an X property could not be understood by the parser. Check it to ensure that it’s well formed and that it contains an appropriate value.
Rocket Validator checks HTML on your sites using the latest version of W3C Validator Nu HTML Checker, which is intended for HTML5 documents.
The page scanned is using an obsolete doctype, instead of the expected <!DOCTYPE html>
.
Learn more:
When specifying a numeric value for a CSS property, remember to always include the units, like 3px
or 3em
. Only the 0
value can go without units, and instead of 0px
you can just use 0
.
Learn more:
The old <acronym>
element in previous versions is now obsolete, in HTML5 you must use <abbr>
instead.
Learn more:
<td>
elements no longer accept an align
attribute. This can be achieved using CSS like this:
<td style="text-align:center;">content</td>
The <big>
tag is now obsolete. It was used to increase the size of text, you can do that using CSS instead. For example:
<p>Now this is <span style="font-size: larger;">big</span></p>
Read more:
<img>
tags no longer accept a border
attribute. This can be defined using CSS instead, for example:
<img src="..." alt="..." style="border:0;" />
The <center>
tag is no longer valid in HTML, you should use CSS instead, for example:
<p style="text-align:center">this text will be centered</p>
A <script>
element has been found that is using the now obsolete charset
attribute. You can safely remove this attribute.
For example, this is using both type
and charset
attributes, with their default values. Both can be removed:
<script src="app.js" type="text/javascript" charset="UTF-8"></script>
and just use this:
<script src="app.js"></script>
Learn more:
The <script>
tag allows authors to include dynamic scripts and data blocks in their documents. This tag accepts two optional attributes, type
(which is unnecessary if it’s JavaScript, as that’s the default), and src
to indicate the URL of the external script to use.
The language
attribute is now obsolete and should not be used.
Read more about:
The <option>
element no longer accepts a name
attribute, which is now obsolete.
Example:
<select id="pet-select">
<option value="">--Please choose an option--</option>
<option value="dog">Dog</option>
<option value="cat">Cat</option>
<option value="hamster">Hamster</option>
</select>
Learn more:
The <meta>
element no longer accepts a scheme
attribute, it’s now obsolete and should be removed.
For example, old documents adhering to old definitions in DCMI (Dublin Core Metadata Initiative) use this HTML tag to define a date:
<meta name="DC.Date.Created" scheme="W3CDTF" content="2009-11-30" />
As the scheme
attribute is now obsolete, it should now be removed. The following HTML code will pass current validations, but you should check the exact definition to use if you want to keep using the DCMI tags.
<meta name="DC.Date.Created" content="2009-11-30" />
Learn more:
The <tt>
tag, used in HTML4 to apply a monospaced (fixed width) font to the text, was deprecated in HTML5. Instead, you should use CSS to apply the desired font.
Example, instead of this deprecated code:
<tt>This is deprecated</tt>
You can define a monospaced text using font-family
:
<span style="font-family: monospace;">This is monospaced text</span>
Learn more:
The HTML <style>
element contains style information for a document, or part of a document, defined in CSS. This element does not need the type
attribute anymore, so it should be omitted.
For example, this style defines that <p>
elements should be in red color.
<style type="text/css">
p {
color: red;
}
</style>
<p>This text will be red.</p>
But, the type
attribute is not used anymore, so we can just use this:
<style>
p {
color: red;
}
</style>
<p>This text will be red.</p>
Read more:
MDN: The Style information element WordPress plugin: Type Attribute Warnings Removal
<td>
elements no longer accept a valign
attribute. This can be achieved using CSS like this:
<td style="vertical-align:middle;">content</td>
In HTML5, there’s no need to specify the version
attribute - it is now obsolete. Here’s an example minimal HTML document to start with:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Test</title>
</head>
<body>
<p></p>
</body>
</html>
Learn more:
Both <table>
and <td>
elements no longer accept a width
attribute. Instead, you should use CSS as in this example:
<table style="width:100%;">
<tr>
<td style="width:50px;">Name</td>
</tr>
</table>
You’re using an attribute X that is no longer valid for element Y, but you can use CSS to achieve the same effect.
When was the last time you validated your whole site?
Keep your sites healthy checking for A11Y/HTML issues on an automated schedule.