css样式表怎么写

1. css内部样式表怎么写 1、创建使用css样式表有三种,分别是外部样式表,内部样式表和内联样式 。下面通过一个小demo演示它们的用法 。
首先新建一个html文件,放入3个button按钮,给前两个按钮分百别设置class属性为btn1和btn2,如下图 。
2.然后准备一个名为demo的CSS文件 。在css文件中写入buttonA的样式,并保存css文件:
3,HTML文件,使用链接在你的样式标签标签的引入上一步创建CSS文件,这是外面的使用风格,是创建一个好的总结度在CSS文件编写风格,然后介绍使用链接的HTML文件标签,这也是大多数网站使用方法,因为它的介绍方便,更方便管理:
4.接下来是内部样式表的使用,其中样式选项卡直接在head选项卡中创建,并添加了btn2样式 。对于内部样式表简单的HTML文件,内部样式很方便,但是复杂的HTML文件可能会让人混淆:
5.最后是使用内联样式,直接在第三个标签中使用样式属性来添加样式可以:
6.最后,保存HTML文件,打开浏览器并查看所有三个按钮的样式 。这就是CSS样式表的制作方法:
2. 刚学HTML,但弄不明白CSS样式表该怎么样写烦 你可以从网上找些相关的html页面,看他们的css样式表,一般是用文本文档写,然后把名字改下就可以了 。
下图 一个是写在页面上的样式,一个是写在样式表里边的样式 。(写在样式表里边的样式要连接到页面上去,否则不会有效果【<link media="screen" href="http://www.xuexi88.com/zhishi/样式表名称" rel="stylesheet" type="text/css">;】)
3. CSS外部样式表怎么写 新建一个 文本吧后缀改为.css
然后直接在xxx.css里写CSS样式
*{
font-family:"黑体";
font-size:12px;
color:#000000;
border:none;
}
比如我xxx.css在D:/myStyle/下
那么我页面就这么引用
如果你.css放在站点下
你就找到他的位置替换 link 下的href 的path就OK了
4. 这个用CSS怎么写 <style>
#bd{ width:287px;}
.title{ background:url(bg.png) repeat; line-height:100px; position:relative; margin-top:-100px; color:#ffffff;}
</style>
<div id="bd">
<img src="http://www.xuexi88.com/zhishi/>
<head>
<style type="text/css">
a.top:link {font-family: 宋体} /*链接字体*/
a.top:link {font-weight: normal;} /*设置链接文字中的字符粗细*/
a.top:link {font-size: 12} /*设置链接文字的大小*/
a.top:link {text-decoration: none;} /*设置链接文字没有下划线*/
a.top:hover {text-decoration: underline;} /*鼠标放在链接上时有下划线*/
a.top:link {color: #000000} /*设置链接文字的颜色*/
a.top:visited {color: #000000} /*访问过的链接*/
a.top:hover {color: #B50000} /*鼠标放在链接上字体的颜色*/
a.tj:link {font-family: 宋体}
a.tj:link {font-weight: normal;}
a.tj:link {font-size: 12}
a.tj:link {text-decoration: none;}
a.tj:hover {text-decoration: none;}
a.tj:link {color: #000000}
a.tj:visited {color: #0000ff}
a.tj:hover {background: #FFFFCC}
h1 {font-size:12px}
h1 {font-family: "宋体"}
h1 {font-weight: normal;}
h1 {color: #000000}
h2 {font-size:14px}
h2 {font-family: "宋体"}
h2 {font-weight: normal;}
h2 {color: #000000}
h3 {font-size:24px}
h3 {font-weight: 1;}
h3 {color: #000000}
body {
margin-top: 1px; /*上边距*/
margin-bottom: 1px; /*下边距*/
}
</style>
<meta ; charset=gb2312"></head>
<body>
<p>Mouse over the links to see them change layout.</p>
<p><b><a href="http://www.xuexi88.com/zhishi/default.asp" target="_blank" class="top">;电脑对怀孕其实没啥影响</a></b></p>