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+SpaceCommand Space).
- Indentation (Ctrl+Alt+ICtrl+Alt+I, Ctrl+Alt+LCtrl+Alt+L).
- Formatting (Ctrl+Alt+LCtrl+Alt+L) according to the code style.
- Intention actions (Alt+EnterAlt+Enter).
- Viewing code structure (Alt+7Command 7).
- Navigation in the source code (Ctrl+BCtrl+B).
- Integrated documentation (Ctrl+QCommand J).
- Search for usages (Alt+F7Alt+F7).
- Commenting and uncommenting lines (Ctrl+Slash; Ctrl+DivideCtrl+Slash; Ctrl+Divide, Ctrl+Shift+Slash; Ctrl+Shift+DivideCommand Shift Slash; Command Shift Divide; Command Shift Slash; Command Shift Divide).
- Unwrapping and removing tags (Ctrl+Shift+DeleteCtrl+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.
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 dialog. By default, specification HTML 4.01 from W3C is assumed.
- CSS: specification CSS 2.1. 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 selectors DIV.warning.
- IntelliJ IDEA uses Xerces 2.6, an XML parser developed by Apache Software Foundation Group.
In this part you will find information that is specific for the web content files only:
- Changing Color Values in Style Sheets
- Generating DTD
- Generating Instance Document from XML Schema
- Generating XML Schema from Instance Document
- Referencing DTD or Schema
- Validating Web Content Files
- Viewing Styles Applied to a Tag
- Viewing Images
- CSS-Specific Refactorings
- Emmet (Zen Coding) Support
- XML-Java Binding
- Minifying CSS
- Transpiling SASS, LESS, and SCSS to CSS