作者:电脑信息网日期:
返回目录:设置问题
水平居中有两种情况:
子元素,父百级元素都是块级元素的时候,度子级元素{margin:0 auto}。需要注意的是当子级元素的position为非知默认及relative时,这种设置会失效。
如p等标签中内的文字内道容水平居中:使用{text-Align:center}。垂直居中设置该元素的行高等内于元素的高。如:{height:100px;line-height:100px}可实现。注容意:这种方法应用于行内元素
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:///TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http:///1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>A标签</title>
<style type="text/css">
*{ margin:0; padding:0;}
a{ color:#00C; text-decoration:none; padding:0 20px;}/*整个页面A标签的属e68a84e8a2ade799bee5baa6333性*/
a:hover{ color:#F00; text-decoration:underline}/*整个页面A标签鼠标滑过属性*/
.one,.two{ width:800px; margin:20px auto; line-height:36px; border:1px solid green;}
.two a{ color:#000;}/*在.two这个div里面A标签的属性*/
.two a:hover{ color:#0F0;}
</style>
</head>
<body>
<div class="one"><a href="#">百度</a><a href="#">新浪</a><a href="#">腾讯</a><a href="#">网易</a></div>
<div class="two"><a href="#">百度</a><a href="#">新浪</a><a href="#">腾讯</a><a href="#">网易</a></div>
</body>
</html>
都知道要获取抄父级了,查看下手册就能袭找到你需要百的答案了。
$(this).parent('.c').siblings('.b').find('.bb').addClass('.bba');
说明一下:parent是获度取知父级,siglings是获取同道级,find是获取子级当然也可以用child
div.side-by-side div {float:left; width: 50%;}
div.side-by-side div em { margin-bottom: 10px; display: block; }
你这百样度写知试道试回。答