Home > Web Front-end > H5 Tutorial > body text

HTML5 对各个标签的定义与规定:style

WBOY
Release: 2016-05-17 09:10:08
Original
1846 people have browsed it

style标签用来定义网站的样式。

可设置属性
media :screen tty tv projection handheld print braille aural all
type:text/css
scoped:true 或者 false
title:有不同的含义

type属性用于设置样式语言的种类,一般情况,也是默认值是text/css。
media属性用于设置该元素适用于哪种媒体,默认为all,即在适合任何媒体。
scoped用于定义该元素的适用范围,如果设置了该属性则意味着元素的作用效果只适用于其父级元素及下属子元素。
title如果有多个style元素设置title属性,那么只有其中一个生效。

Dom接口

代码: 全选 运行

interface HTMLStyleElement : HTMLElement {
           attribute boolean disabled;
           attribute DOMString media;
           attribute DOMString type;
           attribute boolean scoped;
};
HTMLStyleElement implements LinkStyle;

代码实例

 

 

 

 

 

HTMLV.CN HTML5中文论坛 " onclick="changeColor()"/&

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template