

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
HTML style Attribute
The HTML style attribute define an inline style for an element in an HTML document. It is a global attribute that means it can be used on any HTML element.
Syntax
Following is the syntax −
<tagname style=”text”></tagname>
Let us see an example of HTML style Attribute −
Example
<!DOCTYPE html> <html> <style> body { color: #000; height: 100vh; background-color: #8BC6EC; background-image: linear-gradient(135deg, #8BC6EC 0%, #9599E2 100%); } </style> <body> <h1>HTML style Demo</h1> <p>List of subjects: </p> <ol style="font-size:1.2rem;font-weight:bold;"> <li>Physics</li> <li>Chemistry</li> <li>Maths</li> <li>Biology</li> <li>Economics</li> </ol> </body> </html>
Output
- Related Questions & Answers
- How to work with style attribute in HTML?
- How to use style attribute to define style rules?
- HTML accept Attribute
- HTML accesskey Attribute
- HTML autofocus Attribute
- HTML checked Attribute
- HTML Class Attribute
- HTML cols Attribute
- HTML colspan Attribute
- HTML content Attribute
- HTML contenteditable Attribute
- HTML data Attribute
- HTML dir Attribute
- HTML disabled Attribute
- HTML draggable Attribute
Advertisements