css样式字段集
我是 css 新手,我正在尝试找出一种将图例标签合并为 我的页面标题
当前我的母版页由字段集设置样式:
fieldset.field_set_main
{
border-bottom-width:50px;
border-top-width:100px;
border-left-width:30px;
border-right-width:30px;
margin:auto;
width:1300px;
height:700px;
padding:0px 0px 0px 0px;
border-color:Black;
border-style:outset;
display:table;
}
legend.header
{
text-align:right;
}
<fieldset class="field_set_main" >
<legend class="header">
buy for you
</legend>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</fieldset>
如果我将其设置为黑色,图例标题将以其自己的背景颜色“白色”显示 只有标题文本本身“为你购买”是黑色的,它在我的边框右侧显示为白色框,我正在寻找一种 css 样式,使图例显示为页面的标题 (背景颜色与字段集的背景颜色相同,文本的前景色不同)。
字段集中是否有页脚元素,我希望标题也出现在页面底部。
- 有什么有用的 css 样式的好资源吗?特别是对于带有主字段集样式的母版页?
i'm new to css and i'm trying to figure out a way to incorporate a legend tag as an
header for my page
currently my master page is styled by a field set :
fieldset.field_set_main
{
border-bottom-width:50px;
border-top-width:100px;
border-left-width:30px;
border-right-width:30px;
margin:auto;
width:1300px;
height:700px;
padding:0px 0px 0px 0px;
border-color:Black;
border-style:outset;
display:table;
}
legend.header
{
text-align:right;
}
<fieldset class="field_set_main" >
<legend class="header">
buy for you
</legend>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</fieldset>
The legend caption appears with its own background color "white" , if i set it to black
only the caption text itself "buy for you" get's black , it appears as a white box in the right of my border, Ii'm looking for a css style for the legend to appear as an header for the page
( with the same background color as the fieldset's background color , a different forecolor for the text ).Is there a footer element in the fieldset , i want a caption to appear at the bottom of the page as well.
- Any good sources for useful css styles ? especially for master pages styled with a main fieldset ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来您正在尝试使用
fieldset
作为整个页面的容器,并使用legend
作为页面标题。这是对这两个元素语义的误用。如果您需要元素来包装页面以进行样式设置,我强烈建议您将标记和 CSS 更改为:
legend
字段很难一致且完整地设置样式,因此我会避免使用它,除非它是在语义上至关重要,就您而言,听起来绝对不是这样。It sounds like you're trying to use
fieldset
as a container for your entire page, andlegend
as a page header. This is a misuse of the semantics of those two elements.If you need elements to wrap the page for styling, I highly recommend you change your markup and CSS to:
The
legend
field is notoriously hard to style consistently and completely, so I'd avoid its use unless it's semantically vital, which in your case it sounds like that's definitely not the case.