您的当前位置:首页正文

css基本到不能再基本

2024-11-26 来源:个人技术集锦

css基本到不能再基本

css添加到html里的方式

<p style="color:blue;margin-left:20px;">这是一个段落。</p>
  1. 内部样式表:
    在head部分用style标签来定义。
<head>
<style type="text/css">
body {background-color:yellow;}
p {color:blue;}
</style>
</head>
  1. 外部样式表:
    当样式需要被应用到很多页面时,选它。
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
显示全文