Markup Languages and Style Sheets
In this section:
- Markup Languages and Style Sheets
- Changing Color Values in Style Sheets
- CSS-Specific Refactorings
- Editing HTML Files
- Emmet Support
- Generating DTD
- Generating Instance Document from XML Schema
- Generating XML Schema from Instance Document
- Live Editing of HTML, CSS, and JavaScript
- Minifying CSS
- Referencing XML Schemas and DTDs
- Transpiling Sass, Less, and SCSS to CSS
- Using Handlebars and Mustache Templates
- Using JetBrains Chrome Extension
- Validating Web Content Files
- Viewing Actual HTML DOM
- Viewing Pages with Web Contents
- Viewing Images
- Viewing Styles Applied to a Tag
- Working with Sass and SCSS in Compass Projects
- XML-Java Binding
Markup and template languages support
IntelliJ IDEA supports editing of files in the following markup and template languages:
- XML
- HTML/XHTML
- JSP/JSPX
- CSS
- Sass, SCSS
- Slim
- Less
- YAML
- Stylus
- Compass
- Handlebars expressions and Mustache templates
The markup languages and style sheets are integrated into IntelliJ IDEA and can use the most powerful editing features:
- Validation and syntax highlighting.
- Code completion (Ctrl+Space).
- Indentation (Ctrl+Alt+I, Ctrl+Alt+L).
- Formatting (Ctrl+Alt+L) according to the code style.
- Intention actions (Alt+Enter).
- Viewing code structure (Alt+7).
- Navigation in the source code (Ctrl+B).
- Integrated documentation (Ctrl+Q).
- Search for usages (Alt+F7).
- Commenting and uncommenting lines (Ctrl+Slash, Ctrl+Shift+Slash).
- Unwrapping and removing tags (Ctrl+Shift+Delete).
All these features work if IntelliJ IDEA successfully locates the DTD or schema file. In this case, all the files are validated against the DTD or schema, and the editing conveniences become available. Without a DTD or schema, only the well-formedness check is possible.
These features for web contents work same way as for the other source files. Refer to the respective topics of the Advanced Editing Features part for the detailed descriptions of procedures, and to Keyboard shortcuts .
Parsing Web contents
IntelliJ IDEA parses Web contents files according to the following specifications:
- HTML: specification is configurable in the Default HTML language level in the Schemas and DTDs page of the Settings/Preferences dialog. By default, specification HTML 5.0 from W3C is assumed.
- CSS: specification CSS 3.0. The most common selectors are supported: universal
selector
*
, type selectors.a
, descendant selectors.a.b
, child selectors.a .b
, ID selectors#b
, pseudo-classes and class selectorsDIV.warning
. - IntelliJ IDEA uses Xerces 2.11, an XML parser developed by Apache Software Foundation Group.