如何在样式表中使用不带css选择器的*

编程入门 行业动态 更新时间:2024-10-19 10:18:01
本文介绍了如何在样式表中使用不带css选择器的*的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好, 这是我的问题: 我有外部样式表我有*选择器定义为:

* { margin : 0em 4.2 em 0em 0em; padding : 0em; }

现在在我的aspx页面中,我有一个树形视图控件。由于上面的选择器,我的树视图没有正确显示。 这是代码

< div id = treeview 样式 = padding-removed250px; padding-removed150px; width :1040px; margin-removed495px; > < asp:TreeView ID = TreeView1 runat = server ShowLines = true SelectedNodeStyle-ForeColor = 绿色 CssClass = TreeViewClass 样式 = margin:0em 0em 0em 0em!important; SelectedNodeStyle-VerticalPadding = 0 目标 = _ blank > < / asp:TreeView > < / div >

因此,通过从*选择器中删除边距,它正常工作但其他元素受到干扰。所以我在TreeView控件中添加了Style属性,即内联。但它不起作用。我也试过为treeview制作一个不同的cssclass,但是对我没有帮助。 我也试过使用css的not选择器但是这对我不起作用。 我需要你的帮助。我应该怎么做才能保持这些风格?

解决方案

我得到了解决方案 http: //stackoverflow/questions/31709970/how-to-use-not-css-selector-with-in-stylesheet

Hi All, Here is my problem: I have External Style Sheet in which I have "*" selector which defines as:

* { margin: 0em 4.2em 0em 0em; padding: 0em; }

Now in my aspx page I have a tree view control. Because of the above selector my tree view is not showing properly. Here is the code

<div id="treeview" style="padding-removed250px; padding-removed150px; width:1040px;margin-removed495px;"> <asp:TreeView ID="TreeView1" runat="server" ShowLines="true" SelectedNodeStyle-ForeColor="Green" CssClass="TreeViewClass" Style="margin: 0em 0em 0em 0em !important;" SelectedNodeStyle-VerticalPadding="0" Target="_blank"> </asp:TreeView> </div>

So by removing the margin from "*" selector it is working properly but other elements are getting disturbed. So I have added the Style attribute in the TreeView control i.e. inline. But It is not working. I have also tried making a different cssclass for treeview but does not help me. I have also tried using the not selector of css but that doesn't work for me. Please I need your help. What should I do to keep these both styling?

解决方案

I got the solution "stackoverflow/questions/31709970/how-to-use-not-css-selector-with-in-stylesheet"

更多推荐

如何在样式表中使用不带css选择器的*

本文发布于:2023-11-12 04:00:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1580461.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不带   样式表   选择器   如何在   css

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!