boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
BuildingWeb版 - a basic css question
相关主题
HTML颜色代码
Different color text in same table
如何在网页上加google搜索
关于php的问题
HTML help: scrollbar problem
google search 代码是怎么样的呢?
问个入门级的 html 问题
html里怎么设置一部分文本的背景颜色??
新手请教
求助:一个html得问题
相关话题的讨论汇总
话题: title话题: 3px话题: div话题: background话题: wrap
进入BuildingWeb版参与讨论
1 (共1页)
m****r
发帖数: 7
1
Whenever I tried to nest an element in a div, the element does not inherit the
values of the div. For example:
In , I define:
.wrap {background-color: gray;}
.title {position: relative;
margin-top: 3px;
margin-left: 3px;
font-size: 30px;
float: left;}
Then in , I have:
wrap div

The Title of the Page



I place the "title" 3px from the top and 3px from the left of the containing
box "wrap", but the background color of the wra
v***n
发帖数: 53
2
seems has a higher priority and its bgcolor is default as white, if<br /> you add background-color: gray; to .title it should be gray<br /> <br /> the<br /> title<br /> able<br /> <br />【在 m****r 的大作中提到】<a href="#post1"><img border=0 src="/moin_static193/solenoid/img/up.png" style="vertical-align:top;"/></a><br /><span class="zt-cite">: Whenever I tried to nest an element in a div, the element does not inherit the<br />: values of the div. For example:<br />: In <style></style>, I define:<br />: .wrap {background-color: gray;}<br />: .title {position: relative;<br />: margin-top: 3px;<br />: margin-left: 3px;<br />: font-size: 30px;<br />: float: left;}<br />: Then in <body></body>, I have:</span><br /></span></div></td></tr><tr><td class="zt-author">m****r<br />发帖数: 7</td><td width=80% class="zt-bg2"><div id="post3" style="position:relative"><div class="zt-counter">3</div><span>.title is a class name in style sheet, but not <title> in html. Why does it<br /> have a higher priority?<br /> <br /> containing<br /> <br />【在 v***n 的大作中提到】<a href="#post2"><img border=0 src="/moin_static193/solenoid/img/up.png" style="vertical-align:top;"/></a><br /><span class="zt-cite">: seems <title> has a higher priority and its bgcolor is default as white, if<br />: you add background-color: gray; to .title it should be gray<br />: <br />: the<br />: title<br />: able</span><br /></span></div></td></tr><tr><td class="zt-author">v***n<br />发帖数: 53</td><td width=80% class="zt-bg"><div id="post4" style="position:relative"><div class="zt-counter">4</div><span>inheritance applies only to foreground properties. Background properties do<br /> not inherit. Instead, the default background of any element is transparent<br /> unless the brower is specifically told otherwise. This means that the<br /> background color or image properties of the containing element show through on<br /> all its children unless otherwise specified.<br /> <br /> if<br /> inherit<br /> background-color<br /> box.)<br /> <br />【在 m****r 的大作中提到】<a href="#post3"><img border=0 src="/moin_static193/solenoid/img/up.png" style="vertical-align:top;"/></a><br /><span class="zt-cite">: .title is a class name in style sheet, but not <title> in html. Why does it<br />: have a higher priority?<br />: <br />: containing</span><br /></span></div></td></tr> </table></td></tr> <tr><td> <div><table class="searchpages" style="float: right"><tbody><tr> <td></td> <td>1</td> <td></td> <td>(共1页)</td> </tr> </tbody></table></div> </td></tr> <tr><td><table style="table-layout:fixed;width:90%;margin-left:auto;margin-right:auto"><tr><td style="font-size:120%;text-align:center;padding-top:15px"><a href="//forum.weiming.info/c/316" style="color:#F52887;font-weight:bold;text-decoration:underline">进入BuildingWeb版参与讨论</a></td></tr></table></td></tr> <tr><td><table style="table-layout:fixed;width:90%;margin-left:auto;margin-right:auto"><tr><th style="color:#F52887;font-size:105%">相关主题</th></tr><tr><td>● <a href="/zhuti/BuildingWeb/31159734/">求助:一个html得问题</a></td></tr><tr><td>● <a href="/zhuti/BuildingWeb/31162367/">求教 php中的js语句不work</a></td></tr><tr><td>● <a href="/zhuti/BuildingWeb/31171835/">为什么php在$前加奇怪空格?</a></td></tr><tr><td>● <a href="/zhuti/BuildingWeb/2410058/">photoshop fading problem</a></td></tr><tr><td>● <a href="/zhuti/BuildingWeb/2407743/">any one have written a server and brower in java?</a></td></tr><tr><td>● <a href="/zhuti/BuildingWeb/2407877/">ASP一弱问题</a></td></tr><tr><td>● <a href="/zhuti/BuildingWeb/2409000/">no cache CGI output</a></td></tr><tr><td>● <a href="/zhuti/BuildingWeb/2410288/">javascript Q</a></td></tr><tr><td>● <a href="/zhuti/BuildingWeb/31165909/">如何设置重定向仍然显示原有 URL 结构</a></td></tr><tr><td>● <a href="/zhuti/BuildingWeb/2407517/">[转载] Perl for programmers(8): string operation(pattern matching)</a></td></tr></table></td></tr> <tr><td><table style="table-layout:fixed;width:90%;margin-left:auto;margin-right:auto"><tr><th colspan=2 style="color:#F52887;font-size:105%">相关话题的讨论汇总</th></tr><tr><td colspan=2 style="text-align:center;padding-top:10px;font-size:1.1em"><span style="margin-right: 20px"><a href="/huati/title">话题: title</a></span><span style="margin-right: 20px"><a href="/huati/3px">话题: 3px</a></span><span style="margin-right: 20px"><a href="/huati/div">话题: div</a></span><span style="margin-right: 20px"><a href="/huati/background">话题: background</a></span><span style="margin-right: 20px"><a href="/huati/wrap">话题: wrap</a></span></td></tr></table></td></tr> </tbody></table></div> </td></tr> </tbody></table></div> </div> <span class="anchor" id="line-3"></span><span class="anchor" id="bottom"></span></div><div id="pagebottom"></div></div></div><div class="footer"><span class="license">除非另有声明,本站内容采用Creative Commons BY-NC-SA 3.0协议进行许可,转载请注明来自<a href="/">未名观察</a> - <a href="/PrivacyPolicy">隐私政策</a></span><span class="time" lang="zh" dir="ltr">2011-07-24 10:06:12由<span title="admin"><a class="nonexistent" href="/admin" title="admin">admin</a></span>编辑</span> </div> <script> var _gaq=[['_setAccount','UA-18482428-3'],['_trackPageview'],['_trackPageLoadTime']]; (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0]; g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js'; s.parentNode.insertBefore(g,s)}(document,'script')); </script> <script type="text/javascript" src="http://s.skimresources.com/js/27394X857871.skimlinks.js"></script> </body> </html>