CSS 冲突 - ExtJs 网格中的位置:绝对
最近,我将 ExtJs Grid 集成到现有网页中,导致 CSS 冲突。我已经在现有样式表中发现了冲突的 CSS。不幸的是,我无法修改当前的样式表,因为整个网站都是建立在其之上的。
我尝试过使用ctCls、baseCls、bodyCfg、bwrapCssClass和bodyCssClass,但没有达到预期的效果。
下面是我现有网站的冲突样式表,
div
{
font-weight: bold;
font-size: 12px;
visibility: visible;
font-family: Arial, sans-serif;
white-space: nowrap;
position: absolute;
}
样式 position:absolute 导致了冲突。我尝试过 CSS 覆盖,但没有按预期工作。
请注意: 为渲染网格中的每个 DIV 标记设置样式 position:relative 可以解决此问题。我已经使用 IE 开发工具栏模拟了它。
有人可以帮助我如何为渲染的网格进行设置,以便我可以使用 position:relative 成功覆盖母版页 CSS 样式的 position:absolute 。
有人遇到过类似的问题吗?我可以成功覆盖 CSS 吗? 任何帮助将不胜感激。
谢谢
Recently I'd integrated ExtJs Grid into an existing webpage and resulted in a CSS conflict. I'd identified the conflicting CSS in my existing stylesheet. Unfortunately I cannot modify my current stylesheet since the entire website in built on top of that.
I have tried using the ctCls, baseCls, bodyCfg, bwrapCssClass and bodyCssClass, but didnt worked out as expected.
Below is the conflicting stylesheet of my existing website
div
{
font-weight: bold;
font-size: 12px;
visibility: visible;
font-family: Arial, sans-serif;
white-space: nowrap;
position: absolute;
}
The style position: absolute is causing the conflict. I'd tried CSS overriding but is not working as expected.
Please note:
setting the style position: relative to every DIV tag in the rendered grid can fix the issue. I have mocked up that using the IE Developer Toolbar.
Can someone help me how can I set that, for the rendered Grid, so that I can successfully override the position: absolute of the master page CSS style, with position: relative.
Does anyone has faced similar issue? Is it possible for me to override the CSS successfully?
Any help will be appreciated.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为,在页面上的所有
I don't think, that it's a good idea to set CSS styles in such a generic way on ALL
<div>
-elements on a page. But OK... You can try to override the settings using the following CSS rule:我的网络项目遇到了同样的问题,我已经搜索了很长时间才能找到解决方案。问题是两个元素在同一个框架中使用相同的CSS。因此,避免冲突的最佳方法是将网格面板渲染到另一个框架中(始终在同一页面中)。您可以使用 托管 IFrame用户附加信息或uxmedia。我正在使用 uxmedia 扩展。要在 uxmedia 中创建 iFrame:
I had the same problem with my web project and I've searched long time to find the solution. The problem is two elements are using the same Css in the same frame. So the best way to avoid the conflict is rendering your Grid Panel into another frame (always into the same page). You can use Managed IFrame user extension or uxmedia. I'm using uxmedia extension. To create an iFrame in uxmedia: