html+css外链式

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<style type="text/css">
h1{background:red;}
/*这是Css注释*/
p{color:greenyellow;}
div{font-size: 30px;}
.one{color: yellow;}
#two{font-size: 40px;}

#bgimg{background-image:url("Demo_png.png");}
</style>
<link rel="stylesheet" type="text/css" href="Demo_css.css"></link>

</head>

<body>
<h1>四川信息职业技术学院</h1>

<p>贵州赤水市</p>
<div>四川泸州<div>

<div class="one">hello world</div>
<span id="two">你好世界</span>
<!--id在该页面有且只有一个,大部分在js中使用-->
<!--class可以多次出现,css中多使用-->

<p style="color:red;">行内样式css展示</p>
<s>外链式css展示</s>

<div class="bg">背景颜色</div>
<div id="bgimg">背景图片</div> <br>

<div>演示效果</div>
<div>演示效果</div>
<div>演示效果d</div>

<span>演示效果s</span>
<span>演示效果</span>
<span>演示效果</span>

</body>
</html>

-----------------------------------------------------------------------------------------------

@charset "utf-8";
/* CSS Document */
s{color: darkorchid;}
.bg{width:100px;height:auto;background:#4EAD79;}
#bgimg{width:500px;height:500px;background:red; background-image:url("Demo_png.png");background-repeat:no-repeat; background-position: center;}/*背景平铺,不平铺*/

猜你喜欢

转载自www.cnblogs.com/glkj/p/11031100.html