Enter HTML5 entry to proficient:<style> label

Source: Internet
Author: User
Keywords tags HTML5 Getting started to master

"Reprint please retain the integrity of the content of the Wind network article, if you do not comply with this principle, we will retain the right to pursue legal responsibility"

<style> Label

Definitions and usage

The <style> tags define the style information for the HTML document.

In the style element, you specify how HTML elements are rendered in the browser.

Instance

To use the style element in an HTML document:

<html>
<head>
<style type= "Text/css" >
h1 {color:red}
p {Color:blue}
</style>
</head>
<body>
<h1>Header-1</h1>
<p>this is a paragraph.</p>
</body>
</html>

Try it for yourself.

<! DOCTYPE html>
<html>
<head>
<style type= "Text/css" >
h1 {color:red}
p {Color:blue}
</style>
</head>
<body>
<h1>Header-1</h1>
<p>this is a paragraph.</p>
</body>
</html>

Differences between HTML 4.01 and HTML 5

The scoped property is a new attribute in HTML 5 that allows us to define a style for the specified part of the document, not the entire document.

If you use the scoped property, the specified style can only be applied to the parent element of the style element and its child elements.

Wind Network (www.ithov.com) tips and comments:

Wind Network tip: If you want to link external style sheet, please use <link> label.

Wind Network tip: If you need to learn more about style sheet knowledge, please visit the relevant CSS tutorial.

Note: If the scoped property is not defined, the <style> element must be in the <head> section.

Property

The

property Value Description Type TEXT/CSS defines the content type. Media screen


TTY


TV


Projection Handheld


Print


Braille


Aural


the target media for all style information. Scoped scoped If you use this property, the style applies only to the parent element of the style element and its child elements.

Standard properties

<style> tags support standard properties in HTML 5.

Event Properties

<style> tags support event properties in HTML 5.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.