
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Example of embedded CSS
Place your CSS rules into an HTML document using the <style> element that is called embedded CSS. This tag is placed inside <head>...</head> tags. Rules defined using this syntax will be applied to all the elements available in the document.
Following is the example of embed CSS based on the above syntax:
<!DOCTYPE html> <html> <head> <style media = "all"> body { background-color: orange; } h1 { color: yellow; margin-left: 30px; } </style> </head> <body> <h1>This is a heading</h1> <p>This is a paragraph.</p> </body> </html>
The following is the attribute:
Attribute | Value | Description |
---|---|---|
Type | text/css | Specifies the style sheet language as a content-type (MIME type). This is required attribute. |
media | screen tty tv projection handheld braille aural all | Specifies the device the document will be displayed on. The default value is all. This is an optional attribute. |
Advertisements