Style



  1. Stylewe
  2. 2017 Street Style Trends

Accents of Salado has shipped custom furniture nationwide since 1996. When wanting to view fabric, leather, wood and furniture samples please call for an appointment and we will meet you at our Design Studio at 209 S. Main Street in downtown Salado, Texas. Women's Style Icons. 20 Light Linen Dresses for Warm Weather. How to Style a Classic: White Jeans. Meet The Co-Op, the Ivy League Vintage Destination. Golf Outfits That Go from the Green to the Club.


Example

Use of the <style> element to apply a simple style sheet to an HTML document:

<html>
<head>
<style>
h1 {color:red;}
p {color:blue;}
</style>
</head>
<body>
<h1>A heading</h1>
<p>A paragraph.</p>
</body>
</html>
Try it Yourself »

More 'Try it Yourself' examples below.

Definition and Usage

The <style> tag is used to define style information (CSS) for a document.

Inside the <style> element you specify how HTML elements should render in a browser.

Tips and Notes

Note: When a browser reads a style sheet, it will format the HTML document according to the information in the style sheet. If some properties have been defined for the same selector (element) in different style sheets, the value from the last read style sheet will be used (see example below)!

Tip: To link to an external style sheet, use the <link> tag.

Tip: To learn more about style sheets, please read our CSS Tutorial.

Browser Support

Element
<style>YesYesYesYesYes

Attributes

AttributeValueDescription
mediamedia_querySpecifies what media/device the media resource is optimized for
typetext/cssSpecifies the media type of the <style> tag

Global Attributes

The <style> tag also supports the Global Attributes in HTML.

Event Attributes

The <style> tag also supports the Event Attributes in HTML.

More Examples

Example

Multiple styles for the same elements:

<html>
<head>
<style>
h1 {color:red;}
p {color:blue;}
</style>
<style>
h1 {color:green;}
p {color:pink;}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Try it Yourself »

Related Pages

HTML tutorial: HTML CSS

CSS tutorial: CSS Tutorial

HTML DOM reference: Style Object

Default CSS Settings

Most browsers will display the <style> element with the following default values:


Style

Stylewe


Google uses cookies and data to:
  • Deliver and maintain services, like tracking outages and protecting against spam, fraud, and abuse
  • Measure audience engagement and site statistics to understand how our services are used
If you agree, we’ll also use cookies and data to:
  • Improve the quality of our services and develop new ones
  • Deliver and measure the effectiveness of ads
  • Show personalized content, depending on your settings
  • Show personalized or generic ads, depending on your settings, on Google and across the web
For non-personalized content and ads, what you see may be influenced by things like the content you’re currently viewing and your location (ad serving is based on general location). Personalized content and ads can be based on those things and your activity like Google searches and videos you watch on YouTube. Personalized content and ads include things like more relevant results and recommendations, a customized YouTube homepage, and ads that are tailored to your interests.

Click “Customize” to review options, including controls to reject the use of cookies for personalization and information about browser-level controls to reject some or all cookies for other uses. You can also visit g.co/privacytools anytime.