The Cascading Style Sheets (CSS) are used for styling the web content and to help separate layout from presentation.

They can be added to HTML page in three ways:

The style element itself is used to add internal styles to the loaded page. Content between <style> tags is written in a language of Cascading Styles Sheets.

The attribute type defines the CSS content and it has to be set to "text/css".

Syntax:

<style type="text/css" /></style>

Attributes:

  • lang (language information), dir (text direction)
  • title (element title)
  • media (media descriptor)
  • type (content type)

Example

HTML style element:

 

›› go to examples ››