Home  >  Article  >  Web Front-end  >  What does style mean?

What does style mean?

不言
不言Original
2019-01-08 13:46:2843862browse

We often use a style attribute when learning front-end knowledge, so what exactly does style mean? In this article, we will introduce to you the meaning of style. Let’s look at the specific content below.

What does style mean?

c9ccee2e6ea535a969eb3f532ad9fe89 tag is used to define style information for HTML documents. In style, you can specify how the HTML document is rendered in the browser.

The type attribute is required and defines the content of the style element. The only possible value is "text/css", where the style element is in the head section.

In short, we can write various contents of CSS in the style tag and write various styles of CSS. Let’s look at the specific examples

The code is as follows

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title></title>
	<style type="text/css">
		.test{
			height: 200px;
			width: 200px;
			background: skyblue;
		}
	</style>
</head>
<body>
<div class="test"></div>
</body>
</html>

Run Effect

What does style mean?

We define a square with a width and height of 200px in style and a background color of sky blue.

style can also be used directly in tags. The example is as follows

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title></title>
</head>
<body>
<div style="width: 200px;height: 200px;background: lightgreen;"></div>
</body>
</html>

The effect is as follows: You can also define a square with a width and height of 200px and a light green background color.

What does style mean?

This article ends here. For more exciting content, you can pay attention to the php Chinese website! ! !

The above is the detailed content of What does style mean?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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