在HTML里面,有3种方式加入CSS:

1.内嵌(Inline Style)

2.内部样式(Internal Style Sheet)

3.外部样式表(Extenal Style Sheet)

举例如下:

<html>
<head>
<title>背景图片background-image</title>
<STYLE type="text/css"> <!-- 内嵌样式 -->
H1.mylayout {border-width:1; border:solid; text-align:center; color:blue}
</STYLE>
<link href="test.css" rel="stylesheet" type="text/css"> <!-- 外部样式 -->
</head>

<body style="background-image:url(桌面.png)"> <!-- 内嵌样式 -->
<p class="s1">说大话基金汉鼎</p> <!-- 外部样式 -->
<H1 class="mylayout">减肥的惊魂稍定个</H1> <!-- 内部样式 -->
<H1>科技大厦分接开关</H1>

</body>
</html>

相关文章:

  • 2021-09-21
  • 2021-12-31
  • 2021-08-24
  • 2022-12-23
  • 2022-12-23
  • 2021-04-14
  • 2021-09-14
猜你喜欢
  • 2022-01-05
  • 2021-04-27
  • 2021-12-22
  • 2021-10-16
  • 2021-09-29
相关资源
相似解决方案