部分页面使用YUI grid css样式

时间:2013-03-21 08:56:48

标签: css yui

我的页面中有一个菜单栏,我没有应用YUI样式。在此之下,我想要使用YUI样式的三个文档部分。示例代码:     

<?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也会影响其他div部分。我怎么解决这个问题?谢谢!

1 个答案:

答案 0 :(得分:1)

网格不应该影响其他div,但是你似乎正在加载reset-fonts-grid,重置部分会影响其他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

相关问题