2013-03-21 33 views
0

我有一个菜单栏在我的页面,我不适用于YUI风格。在那之下,有三个我想使用YUI风格的doc部分。示例代码: 使用YUI网格css风格的部分页面

<?php 
include("style.html"); 
?> 

<script src="http://yui.yahooapis.com/3.9.0/build/yui/yui-min.js"></script> 
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.9.0/build/grids/grids-min.css"> 
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.9.0/build/reset-fonts-grids/reset-fonts-grids.css"> 

</head> 
<body> 
<div><h1>HEAD</h1></div> 

<div id=top>TOP MENU</div> //top is defined in the included style html file 

<div class="yui-gb"> 
    <div class="yui-u first">BODY PART</div> 

..... 

我使用YUI的部分是好的,但YUI的影响其他分区的部分了。我该如何解决这个问题?谢谢!

回答

1

网格不应该影响其他div,但你似乎正在加载重置字体网格,重置部分会影响其他div。你似乎也加载3.9.0 YUI,但从2.x版本(2.9.0)CSS我建议避免穿越该障碍,除非你真的知道你为什么要。

也有3.9.0的复位,字体和网格CSS文件。在使用3.9.0版本的情况下,您可以使用上下文重置类来约束它所针对的页面部分。为此,您需要加载“cssreset-context/cssreset-context-min.css”,然后将“yui3-cssreset”类添加到要重置的容器中。这是在这里记录:

http://yuilibrary.com/yui/docs/cssreset/#context