简体   繁体   English

将.panel与FIELDSET结合使用.panel-heading与LEGEND结合使用时的设计问题

[英]Design issues when combining .panel with FIELDSET and .panel-heading with LEGEND

For accessibility reasons I need to add fieldset and legend to Bootstrap's .panel element. 对于辅助功能的原因,我需要添加fieldsetlegend来引导的.panel元素。 But sadly, the legend can't be styled correctly anymore: the border around fieldset only comes to the middle height! 但是可悲的是,无法正确设置legend样式: fieldset周围的边框仅达到中间高度!

截图

Codepen: http://codepen.io/jmuheim/pen/ByMVwY Codepen: http ://codepen.io/jmuheim/pen/ByMVwY

Anyone knows how to make the fieldset.panel-heading look exactly the same as the div.panel-heading ? 有谁知道如何使fieldset.panel-headingdiv.panel-heading完全相同?

You can add float left to the legend tag. 您可以将浮点数添加到legend标签。 Since the width is already set to 100%, it should not cause any issues 由于宽度已经设置为100%,因此不会引起任何问题

http://codepen.io/anon/pen/LEqrBR http://codepen.io/anon/pen/LEqrBR

legend.panel-heading {
    font-size: 14px;
    margin-bottom: 0;
    float: left;
}

I checked this on FF and Chrome on a Mac, seems fine. 我在FF和Mac上的Chrome上进行了检查,似乎还不错。 To get the spacing right for the body part, you could add a margin to the legend tag. 要获得正确的身体部位间距,您可以在legend标签中添加边距。 For example 例如

margin-bottom: 10px;

http://codepen.io/anon/pen/dPaKgv http://codepen.io/anon/pen/dPaKgv

I attempted something similar yesterday. 昨天我尝试过类似的事情。 This post will probably have what you need. 这篇文章可能会满足您的需求。

Use Fieldset Legend with bootstrap 在引导程序中使用Fieldset Legend

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM