"."/> ".">
Home >Web Front-end >Front-end Q&A >Which html attribute can define inline styles
html's style attribute can define inline styles. The style attribute of the tag is used to specify the inline style (inline style) of the element. You only need to add the style attribute to the tag and set the attribute value. The syntax "
".
The operating environment of this tutorial: Windows7 system, CSS3&&HTML5 version, Dell G3 computer. The style attribute of
html can define inline styles.
The style attribute specifies the inline style of the element. The style attribute will override any global style settings, such as in the
Syntax:
<!doctype html> <html> <head> <meta charset="utf-8"> <title>行内样式(内联样式)</title> </head> <body> <p style="background-color: #999900">行内元素,控制段落-1</p> <h2 style="background-color: #FF6633">行内元素,h2 标题元素</h2> <p style="background-color: #999900">行内元素,控制段落-2</p> <strong style="font-size:30px;">行内元素,strong 比 em 效果要强</strong> <div style="background-color:#66CC99; color:#993300; height:30px; line-height:30px;">行内元素,div 块级元素</div> <em style="font-size:2em;">行内元素,em 强调</em> </body> </html>
Rendering:
Related recommendations: "
css video tutorialThe above is the detailed content of Which html attribute can define inline styles. For more information, please follow other related articles on the PHP Chinese website!