css三种样式!
内部样式表
内部样式表需要在网页的<head>部分定义,格式如下:
<head>
<style type="text/css">
/*符合CSS语法结构的CSS语句,例如*/
body { background-color: blue; }
</style>
</head>
行内样式表(内嵌样式表)
行内样式表直接在标签内部定义,使用style属性,写法如下:
<标签 style="符合CSS语法结构的CSS语句">
例如:
<p style="text-indent:24px;">段落内容</p>
外部样式表
使用外部样式表时,CSS文件与网页文件(html)是分离开来的。要让某一个网页调用一个外部CSS文件,你需要在网页的<head>部分插入以下内容:
<head>
<link rel="stylesheet" type="text/css"
href="文件位置/你的CSS文件名.css" />
/*文件位置就是所处在的文件夹相对与当前网页的相对路径*/
</head>
相关文档:
.equal {
margin-bottom:-32767px;
padding-bottom:32767px;
}
.left{
float:left;
margin-left:5px;
overflow:hidden;
width:295px;
}
.right {
float:right;
overflow:hidden;
width:245px;
}
<div class=’left equal’>数据任意长度,可以自行copy很长一断来测试</div>
......
1、容器不扩展问题
这个是经常在我切图的时候遇到的问题,如:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content= ......
<style>
.a
{
background-color:#000000;
}
.b
{
background-color:#ffffff;
}
</style>
<ul>
<li id="aaa1" onclick="setClassName(this,'a')"> <a href="#">aaaa</a> </li>
<li id="aaa2" onclick="setClassName(this,'a')"> <a href="#"&g ......
这些都是之前学习的时候总结的,现在把它们都上传上来:
DIV+CSS面试八个题是之前在哪个网站看到了,现在怎么也找不到了,索性自己留一份吧!
一、超链接访问过后hover样式就不出现的问题?
被点击访问过的超链接样式不在具有hover和active了,解决方法是改变CSS属性的排列顺序: L-V-H-A
二、IE6的双倍边距BUG
......