How to set style in html

青灯夜游
Release: 2023-01-06 11:13:29
Original
21158 people have browsed it

htmlHow to set style: 1. Write the style directly in the style attribute of the element tag, with the syntax ""; 2. In the style tag of the head part , write the style code with the syntax "".

How to set style in html

The operating environment of this tutorial: Windows7 system, CSS3&&HTML5 version, Dell G3 computer.

htmlHow to set style

1. Use the HTML style attribute

in the tag Inside the beginning part,

<element style="样式的属性名1:样式的属性值1;属性名2:属性值2;......">
Copy after login

is included in the style attribute. For example:

<div style="color:red"></div>
Copy after login

2. Use the HTML