directly?)
一般来说,当我们有一些应该一起设置样式的子元素时,我们应该将该样式放到父级并让继承工作,还是给孩子们自己? 例如,如果我们有如下结构:
<div class="foo">
<p>should be 2em</p>
<ul>
<li>should be 2em</li>
<li>should be 2em</li>
</ul>
</div>
然后我应该这样做:
.foo {font-size: 2em}
或类似的东西?:
.foo p, .foo li {font-size: 2em}
我认为这个问题非常基本,但很抱歉我找不到任何好的谷歌搜索结果。
Generally speaking, when we have some child elements that should be styled together, should we put that style to the parent and let the inheritance work, or to the children themselves? For example, if we have a structure as below:
<div class="foo">
<p>should be 2em</p>
<ul>
<li>should be 2em</li>
<li>should be 2em</li>
</ul>
</div>
then should I make it as this:
.foo {font-size: 2em}
or something like this?:
.foo p, .foo li {font-size: 2em}
I think this question is very basic, but sorry I couldn't find any good google result.
0,0有可能CSS路径错了。A.你用DW自动导入CSS,看是不是CSS/xinjian.css还是../css/xinjian.css。
B.在一个就是你后来写的CSS优先级没有链接的那个高了,自然你后来写的就没有效果了。(测试方法,写个外部没有的样式,比如添加个背景颜色什么的,如果显示了就是这个问题,没显示就是没连上)
<html><head>
<meta http-equiv="Content-Type" content="text/htmlcharset=gb2312">
<title>11</title>
<style type="text/css">
body{text-align:center}
td {font-size: 12pxline-height:160%}
.dotline{background-image:url(images/dot_line.gif)background-repeat: repeat-xbackground-position: bottom}
</style>
</head>
<body>
<script language=JavaScript src="js/js.js"></script>
<table width="600" border="0" cellspacing="2" cellpadding="0">
<tr>
<td width="56" height="40" align="right" class="dotline"><img src="images/ico_q.gif" width="47" height="29"></td>
<td width="544" height="40" class="dotline"><a onClick=javascript:ShowFLT(1) href="javascript:void(null)">1.为什么我在加入购物车的时候提示“数量已超过该物品库存”?</a></td>
</tr>
<tr id=LM1 style="DISPLAY: none">
<td height="30" align="right" bgcolor="#f5f9ed"><img src="images/ico_a.gif" width="14" height="14" hspace="5"></td>
<td height="30" bgcolor="#f5f9ed">这是因为您要购买的数量超过了我们目前仓库中该物品的数量。比如说您想购物10件物品,而我们目前只有5件库存,所以系统会出现该提示,并会把尽可能多的物品加入您的购物车。</td>
</tr>
<tr>
<td height="40" align="right" class="dotline"><img src="images/ico_q.gif" width="47" height="29"></td>
<td height="40" class="dotline"><a onClick=javascript:ShowFLT(2) href="javascript:void(null)">2.“下次自动登录”有什么用?</a></td>
</tr>
<tr id=LM2 style="DISPLAY: none">
<td height="30" align="right" bgcolor="#f5f9ed"><img src="images/ico_a.gif" width="14" height="14" hspace="5"></td>
<td height="30" bgcolor="#f5f9ed"><p>如果您是我们的会员,在您登录的时候,会有一个下次自动登录选项。如果您是在家或者办公室上网的话,您可以选中它,这样当您下次再来的时候,就不用再手工登录了,会自动识别出您,并自动登录。</p>
</td>
</tr>
<tr>
<td height="40" align="right" class="dotline"><img src="images/ico_q.gif" width="47" height="29"></td>
<td height="40" class="dotline"><a onClick=javascript:ShowFLT(3) href="javascript:void(null)">3.为什么在付款的时候要“多加一个尾数”?</a></td>
</tr>
<tr id=LM3 style="DISPLAY: none">
<td height="30" align="right" bgcolor="#f5f9ed"><img src="images/ico_a.gif" width="14" height="14" hspace="5"></td>
<td height="30" bgcolor="#f5f9ed">因为我们的定单较多,难免会出现多个顾客同时汇款的情况。加个尾数可以方便我们识别您的汇款,以减少不必要的麻烦,并第一时间给您发货。如果有可能的话,我们还建议在您的汇款或者转帐附言中写明您的订单号。当然,您在付款后及时的通知我们也是必不可少的。</td>
</tr>
<tr>
<td height="40" align="right" class="dotline"><img src="images/ico_q.gif" width="47" height="29"></td>
<td height="40" class="dotline"><a onClick=javascript:ShowFLT(4) href="javascript:void(null)">4.什么是TrackBack,对我而言有何意义?</a></td>
</tr>
<tr id=LM4 style="DISPLAY: none">
<td height="30" align="right" bgcolor="#f5f9ed"><img src="images/ico_a.gif" width="14" height="14" hspace="5"></td>
<td height="30" bgcolor="#f5f9ed">简单说来,TrackBack 被设计用来提供一种方法以实现网站之间的互相通告。利用这种简单使用的方式,可以让您实现主动推送(Push)一条相关信息加进产品页面内。这样,不仅使用户在访问我们的网站时得到的高价值信息量更多,更能使您的 Blog 吸引到与您志同道合的朋友。</td>
</tr>
<tr>
<td height="40" align="right" class="dotline"><img src="images/ico_q.gif" width="47" height="29"></td>
<td height="40" class="dotline"><a onClick=javascript:ShowFLT(5) href="javascript:void(null)">5.我的 Blog 是否也支持 Trackback?</a></td>
</tr>
<tr id=LM5 style="DISPLAY: none">
<td height="30" align="right" bgcolor="#f5f9ed"><img src="images/ico_a.gif" width="14" height="14" hspace="5"></td>
<td height="30" bgcolor="#f5f9ed">作为一种协议和一项功能对其进行了实现,这是 TrackBack 的第一个实现。由于只有众多的站点都支持TrackBack,它的真正价值才能得以体现,所以 TrackBack 从一开始就被设计为一个开放系统:一个其它的 blog 工具能很简单地实现的开放系统。</td>
</tr>
</table>
</body>
</html>
-----------------------------------------JS脚本:命名:js.js------------------------------------
var number=5//定义条目数
function LMYC() {
var lbmc
for (i=1i<=numberi++) {
lbmc = eval('LM' + i)
lbmc.style.display = 'none'
}
}
function ShowFLT(i) {
lbmc = eval('LM' + i)
if (lbmc.style.display == 'none') {
LMYC()
lbmc.style.display = ''
}
else {
lbmc.style.display = 'none'
}
}
你参照这个做下修改就好了