Css 使用模块的样式覆盖门户的样式-div标记之间的空格
我有一些标签与文本框和下拉列表水平对齐。下拉列表和文本框之间出现间隙。如果我检查元素,它会向我显示门户的css文件,其中不包括导致我希望减少的间隙/垂直空间的信息。我想要的是覆盖模块级别上的这些设置 在屏幕截图上,我用firefox上的“web开发者”工具突出显示了这种风格。此时会出现下拉列表之间的间隙Css 使用模块的样式覆盖门户的样式-div标记之间的空格,css,html,dotnetnuke,dotnetnuke-module,Css,Html,Dotnetnuke,Dotnetnuke Module,我有一些标签与文本框和下拉列表水平对齐。下拉列表和文本框之间出现间隙。如果我检查元素,它会向我显示门户的css文件,其中不包括导致我希望减少的间隙/垂直空间的信息。我想要的是覆盖模块级别上的这些设置 在屏幕截图上,我用firefox上的“web开发者”工具突出显示了这种风格。此时会出现下拉列表之间的间隙 <div class="ColOne"> <asp:Label ID="lblCategory" runat="server" Text="Category"
<div class="ColOne">
<asp:Label ID="lblCategory" runat="server" Text="Category" CssClass="labelStyle" style="position: relative"></asp:Label>
</div>
<div >
<asp:DropDownList ID="ddlCategory" runat="server" DataSourceID="sqlCategories" DataTextField="Name" DataValueField="CategoryID" AutoPostBack="True"></asp:DropDownList>
</div>
<div class="ColOne">
<asp:Label ID="lblSubCategory" runat="server" Text="Sub Category" CssClass="labelStyle"></asp:Label>
</div>
<div >
<asp:DropDownList ID="ddlSubCategory" runat="server" DataSourceID="sqlSubCategory" DataTextField="Name" DataValueField="SubCategoryID"></asp:DropDownList>
</div>
单击显示样式信息,我将获得以下信息:
/* Line 28 */
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, caption, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video
{
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
margin-left: 0px;
padding-top: 0px;
padding-right: 0px;
padding-bottom: 0px;
padding-left: 0px;
border-top-width: 0px;
border-right-width-value: 0px;
border-bottom-width: 0px;
border-left-width-value: 0px;
border-top-style: none;
border-right-style-value: none;
border-bottom-style: none;
border-left-style-value: none;
border-image-source: none;
border-image-slice: 100% 100% 100% 100%;
border-image-width: 1 1 1 1;
border-image-outset: 0 0 0 0;
border-image-repeat: stretch stretch;
font-family: inherit;
font-style: inherit;
font-variant: inherit;
font-weight: inherit;
font-size: inherit;
line-height: inherit;
font-size-adjust: inherit;
font-stretch: inherit;
}
我通过添加以下内容来修复它
div.ColEmpty input[type="text"], select, textarea {
margin-top:0;
position: relative;
line-height:0px;
top: 2px;
margin-bottom: 0px;
}
<div class="ColEmpty">
<asp:DropDownList ID="ddlSubCategory" runat="server" DataSourceID="sqlSubCategory" DataTextField="Name" DataValueField="SubCategoryID"></asp:DropDownList>
</div>
你有没有试过去掉上面的填充物:12px;来自科隆分区?否则,您提供的代码中没有任何原因this@SW4我现在已经测试过了,但它不会影响差距。我使用填充顶部:12px在中间移动标签的文本。我想我们需要更多的代码,或者一个生动的例子。debug@SW4我不能提供一个自动取款机的实例。请让我知道您希望看到代码的哪一部分。我刚刚添加了从default.css获得的代码
div.ColEmpty input[type="text"], select, textarea {
margin-top:0;
position: relative;
line-height:0px;
top: 2px;
margin-bottom: 0px;
}
<div class="ColEmpty">
<asp:DropDownList ID="ddlSubCategory" runat="server" DataSourceID="sqlSubCategory" DataTextField="Name" DataValueField="SubCategoryID"></asp:DropDownList>
</div>