简体   繁体   English

CSS选择器的嵌套

[英]Nesting of CSS Selectors

I have a simple HTML page with divs nested within each other. 我有一个简单的HTML页面,它们的div相互嵌套。 And then I have another HTML page which displays a grid. 然后,我还有另一个显示网格的HTML页面。 The grid is styled using a stylesheet. 使用样式表对网格进行样式设置。 Now I want to embed this grid within the 1st HTML page. 现在,我想将此网格嵌入到第一个HTML页面中。 So I have created a div inside the 1st page and set the source as the 2nd HTML page (which contains the code for displaying grid). 因此,我在第一页中创建了一个div,并将源设置为第二HTML页(其中包含用于显示网格的代码)。 Now the problem is, the stylesheet which was developed had the CSS selectors dependent on the structure of the 2nd Page. 现在的问题是,开发的样式表具有依赖于第二页结构的CSS选择器。 But now since I have embedded the code in the 1st file, I think the selectors and not getting applied and hence the grid not getting styled. 但是现在由于我已经将代码嵌入到第一个文件中,所以我认为选择器并没有被应用,因此网格也没有被设置样式。 How do I solve this problem ? 我该如何解决这个问题?

Maybe embedding the grid using an <iframe> would be acceptable for you. 也许可以使用<iframe>嵌入网格。 Then you would not have to change any CSS code. 然后,您将不必更改任何CSS代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM