我一直在调整一些CSS,我正在改变锚标签的样式。这很好。让我感到困惑的是为什么这个样式会影响到具有不同类/ ID的完全不同的div中的某些东西? (例如,我的小风格为页面底部的一个小块添加了样式,但由于一些奇怪的原因,它开始影响Admin导航栏顶部)顺便说一下,我正在使用DotNetNuke皮肤。
浏览Chrome中的Inspect选项,就像它继承了这些样式一样,即使我创建的这个样式类没有链接!
我已经检查了我的DIV并正确配对了。
所以我只是想知道还有什么我可以检查以试图阻止这种情况发生。我可能会遗漏一些非常简单/明显的东西。
谢谢!
编辑:嗯,显然我应该包含代码;)愚蠢的我!好的,这是影响皮肤的CSS代码:
#ehcbreadcrumbs {
background-color: #BCBCBC;
color: White;
font-size: 1.1em;
padding-top: 4px;
padding-right: 0px;
padding-bottom: 4px;
padding-left: 10px;
margin-top: 5px;
}
#ehcbreadcrumbs a, a:link {
text-decoration: none;
color: White;
font-size: 1.1em;
}
#bottomnavbar {
padding-top: 4px;
padding-bottom: 4px;
display: table;
}
#bottomnavbar ul {
margin: 0 auto;
}
#bottomnavbar ul li {
display: inline;
}
#bottomnavbar a, a:link {
text-decoration: none;
}
#bottomnav a, a:link {
font-size: 14px;
}
这是皮肤文件:
<%@ Control language="vb" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Skin" %>
<%@ Register TagPrefix="dnn" TagName="LANGUAGE" Src="~/Admin/Skins/Language.ascx" %>
<%@ Register TagPrefix="dnn" TagName="LOGO" Src="~/Admin/Skins/Logo.ascx" %>
<%@ Register TagPrefix="dnn" TagName="SEARCH" Src="~/Admin/Skins/Search.ascx" %>
<%@ Register TagPrefix="dnn" TagName="NAV" Src="~/Admin/Skins/Nav.ascx" %>
<%@ Register TagPrefix="dnn" TagName="TEXT" Src="~/Admin/Skins/Text.ascx" %>
<%@ Register TagPrefix="dnn" TagName="BREADCRUMB" Src="~/Admin/Skins/BreadCrumb.ascx" %>
<%@ Register TagPrefix="dnn" TagName="USER" Src="~/Admin/Skins/User.ascx" %>
<%@ Register TagPrefix="dnn" TagName="LOGIN" Src="~/Admin/Skins/Login.ascx" %>
<%@ Register TagPrefix="dnn" TagName="LINKS" Src="~/Admin/Skins/Links.ascx" %>
<%@ Register TagPrefix="dnn" TagName="PRIVACY" Src="~/Admin/Skins/Privacy.ascx" %>
<%@ Register TagPrefix="dnn" TagName="TERMS" Src="~/Admin/Skins/Terms.ascx" %>
<%@ Register TagPrefix="dnn" TagName="COPYRIGHT" Src="~/Admin/Skins/Copyright.ascx" %>
<%@ Register TagPrefix="dnn" TagName="STYLES" Src="~/Admin/Skins/Styles.ascx" %>
<%@ Register TagPrefix="dnn" TagName="MENU" Src="~/DesktopModules/Infinity.Menu/ViewMenu.ascx" %>
<%@ Register TagPrefix="snapsis" Namespace="Snapsis.DNN.Skins" Assembly="Snapsis.DNN.NavMenu" %>
<%@ Register TagPrefix="ddr" TagName="DDRMENU" src="~/DesktopModules/DDRMenu/Menu.ascx" %>
<%@ Register TagPrefix="ddr" Namespace="DotNetNuke.Web.DDRMenu.TemplateEngine" Assembly="DotNetNuke.Web.DDRMenu" %>
<%@ Register TagPrefix="google" TagName="FOOTER" Src="Footer.ascx" %>
<script src="<%= Page.ResolveUrl("Portals/_default/Skins/ehc2011/js/common.js") %>" type="text/javascript"></script>
<div class="cpanel_right">
<div class="cpanel_left">
<div runat="server" id="ControlPanel"></div>
</div>
</div>
<div class="clear"></div>
<div class="wrapper">
<div class="layout">
<!--Head Start-->
<div class="BCKhead">
<div class="logo"><dnn:LOGO runat="server" id="LOGO1" />
<h1 class="hideFromView">XXXXXX</h1>
<h2 class="hideFromView">XXXXXXX</h2>
</div>
<div class="top">
<div class="topmenu">
<ul>
<li class="last"><a href="/TheXXXXpilot/Deliveringtheproject/Theprojectteam/tabid/66/language/en-AU/Default.aspx" title="Contact Us">Contact Us</a></li>
<li><a href="/TheXXXXpilotprogram/FrequentlyAskedQuestions/tabid/137/language/en-US/Default.aspx" title="View the FAQ">FAQ</a></li>
<li><a href="/UsetheXXXX/tabid/155/language/en-US/Default.aspx" title="Use the XXXX">Use the XXXX</a></li>
</ul>
<div class="clear"></div>
</div>
<div class="accessibility">
<a href="javascript:changeFontSize(-1)" title="Decrease font size"><img src="<%= Page.ResolveUrl("Portals/_default/Skins/ehc2011/images/resizesmall.gif") %>" alt="Decrease font size"/></a> <a href="javascript:changeFontSize(1)" title="Increase font size"><img src="<%= Page.ResolveUrl("Portals/_default/Skins/ehc2011/images/resizelarge.gif") %>" alt="Increase font size"/></a>
</div>
<div class="searchbox">
<div style="display:none"></div>
<div id="dnn_dnnSEARCH_DropDownSearch">
<dnn:SEARCH ShowWeb="false" ShowSite="false" UseDropDownList="false" Submit="Search" runat="server" ID="dnnSearch2" CssClass="searchbox"/>
</div>
</div>
</div>
<div class="clear"></div>
</div>
<!--Head End-->
<!--Container Start-->
<div class="container_inner" id="container_inner">
<div class="leftcontent">
<div class="mainmenu innerHeight">
<Snapsis:NavMenu id="LeftNav" CacheTabs="false" Level="0-2" Type="Hover"
OnlyExpandActive="false" ShowType="Always"
EnableViewState="true"
runat="server" ExcludeTabs="Admin,Host" />
<div class="clear"></div>
</div>
<div style="height:5px; overflow:hidden; background:#fff;" id="WhiteDiv"></div>
<div id="LeftPane" runat="server" class="LeftPane"></div>
</div>
<div class="rightcontent">
<div class="banner"><a href="/UsetheXXXX/tabid/155/language/en-US/Default.aspx" ><img src="<%= Page.ResolveUrl("Portals/_default/Skins/BCKGraphic/images/inner_banner.jpg") %>" /></a></div>
<div class="RightDiv">
<div id="ehcbreadcrumbs">
<dnn:TEXT runat="server" id="dnnTEXT" Text="You are here >" ResourceKey="Breadcrumb" /> <dnn:BREADCRUMB ID="dnnBREADCRUMB" RootLevel="0" Separator=" > " runat="server" />
</div>
<div id="RightPane" runat="server" class="RightPane"></div>
</div>
</div>
<div class="clear"></div>
<div id="ContentPane" runat="server" class="ContentPane"></div>
<div class="clear"></div>
</div>
<div class="clear"></div>
<div class="clear"></div>
<!--Container End-->
<div class="bottomcontent"></div>
<div id="bottomnavbar">
<ddr:DDRMENU MenuStyle="sitemap" NodeSelector="RootOnly" runat="server" ></ddr:DDRMENU>
</div>
</div>
</div>
<!--Foot Start-->
<div class="footer">
<div class="footer_con">
<div>footer text</div>
<div class="clear"></div>
</div>
</div>
<% If DotNetNuke.Security.PortalSecurity.IsInRoles("Administrators") Then%>
<div class="copyright">
Logged in as <dnn:USER runat="server" id="dnnUSER" CssClass="user" /> |
<dnn:LOGIN runat="server" id="dnnLOGIN2" CssClass="copyright" Text="Login" />
</div>
<%End If%>
<!--Foot End-->
<dnn:STYLES runat="server" id="StylesIE6" Name="IE6Minus" StyleSheet="css/ie6skin.css" Condition="LT IE 7" UseSkinPath="true" />
<script type="text/javascript" >
if(dnn_LeftPane.className.indexOf("DNNEmptyPane") != -1)
{
if(dnn_ContentPane.className.indexOf("DNNEmptyPane") == -1)
{
document.getElementById("WhiteDiv").style.display = "none";
document.getElementById("container_inner").className = "container_inner_setting";
}
}
else
{
document.getElementById("WhiteDiv").style.display = "";
document.getElementById("container_inner").className = "container_inner";
}
</script>
<google:FOOTER id="footer1" runat="Server"></google:FOOTER>
因此,bottomnavbar / bottomcontent中的样式似乎会影响DNN管理栏(ControlPanel)的某些方面。如果我更改bottomnavbar中的字体大小,它也会影响登录的用户部分,“copyright”块中的字体大小也会改变大小。这让我感到困惑,因为DIV阻挡(对我而言)看起来正确配对了 是的,我知道它不是很漂亮;)(皮肤最初是由其他人创建的,我已经接管了对它进行更改)
答案 0 :(得分:2)
您的问题是COMMA
#ehcbreadcrumbs a, a:link {
应该是
#ehcbreadcrumbs a, #ehcbreadcrumbs a:link {
同样的事情
#bottomnavbar a, a:link {
应该是
#bottomnavbar a, #bottomnavbar a:link {
等