Java Reference
In-Depth Information
HTML files
Any file type registered as belonging to the generic designation of
HTML
auto-
matically inherits the ability to use all the
HTML
features discussed in this section.
By default,
IDEA
maps the following extensions to the
HTML
file type:
.htm
■
.html
■
.shtml
■
.shtm
■
.sht
■
The
HTML
file format supports both traditional
HTML
as well as the more rigidly
structured
XHTML
. For the loosely parsed, more typical
HTML
file,
IDEA
offers
warnings and errors based on the official
HTML
4.01 specification from the
W3C
,
but it doesn't complain about
XML
-related issues such as entity declarations and
empty tags that aren't properly closed. It does, however, enforce proper structure
for non-empty tags, such as
<table>
missing its
</table>
closing tag. Also be
aware that most browsers have added support for their own nonstandard
attributes and tags and that
IDEA
flags these as unrecognized, because they fall
outside the core specification. More on document syntax validation later.
IDEA
maintains a separate list of file type extensions for
HTML
and
XHTML
,
but it only enforces
XML
-related structure and syntax problems in
XHTML
files if you've included a proper
XML
header. For example:
NOTE
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en">
CSS files
Cascading stylesheets are now a mainstay of web development, and
IDEA
5.0 has
appropriately added support for this format. By default,
IDEA
recognizes the .css
file extension for these file types. For purposes of validation,
IDEA
uses the
W3C
's
CSS
2.1 specification. As with nonstandard
HTML
,
IDEA
complains about any
browser-specific stylesheet properties.