Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Take A QuizChallenge yourself and boost your learning! Start the quiz now to earn credits.
Take A QuizUnlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Take A QuizWhen writing in HTML, the <style> tag is used to change the appearance and position of various elements on a WEB page. It is placed in the document's <head> and implemented as a class, or used for applying inline CSS to a single element. The following SECTIONS contain information about this tag, including an example of it in use, and related attributes and browser compatibility.
Style tag with CSS<style TYPE="text/css"> <!-- p { color:orange; } --> </style>NoteWith HTML5, you no longer need to specify the type="text/css" attribute in the tag.
Element with a style attribute example code<p style="color:orange">This paragraph contains orange text!</p>Example resultThis paragraph contains orange text!
AttributesWithin an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support STANDARD attributes. The following table shows all of the current unique HTML attributes for the <style> tag, and a description of each.
NoteThe type attribute is optional in HTML5, but still required in HTML 4.
Attribute | Description |
---|---|
disabled | Designates that the <style> should not be applied to the current document. |
media | Designates what media/device for a media resource. |
scoped | Designates that the styles only apply to this element's parent element. |
type | Designates the media type of a <style> element. |
Edge | Internet Explorer | Firefox | Safari | Opera | Chrome |
---|---|---|---|---|---|
All versions | All versions | All versions | All versions | 5.0+ | All versions |
Turn Your Knowledge into Earnings.
Ever curious about what any word really means? Dictionary has got them all listed out for you to explore. Simply,Choose a subject/topic and get started on a self-paced learning journey in a world of word meanings and translations.
Write Your Comments or Explanations to Help Others