简体   繁体   English

Internet Explorer中的字段集图例

[英]Fieldset Legend in Internet Explorer

I'm pulling my hair out here. 我在这里拔头发。

I'm styling the front end of an ASP.NET built site, one of the sections is a fieldset with a legend, however this area looks totally different between IE, firefox and chrome. 我正在设计一个ASP.NET构建站点的前端,其中一部分是带有图例的字段集,但是IE,firefox和chrome之间的区域看起来完全不同。 IE being by far the most off. IE是目前为止最便宜的。 I don't have the ability to load browser specific stylesheets with the way that this build is set up, but I can use css browser specific hacks in the one stylesheet. 我无法使用设置此版本的方式来加载特定于浏览器的样式表,但是我可以在一个样式表中使用CSS特定于浏览器的技巧。

This is how it looks in firefox: 这是在Firefox中的外观: Firefox屏幕截图

This is how it looks in chrome: 这是在chrome中的外观: Chrome屏幕截图

This is how it looks in IE: 这是在IE中的外观: IE屏幕截图

This is my html and css for the fieldset and legend: 这是我的html和CSS的字段集和图例:

 #TabContainerAlerts_TabPanelBloodPressureAlerts_UpdatePanelBloodPressureAlerts > fieldset, #TabContainerAlerts_TabPanelGlucoseAlerts_UpdatePanelGlucoseAlerts > fieldset, #TabContainerAlerts_TabPanelWeightAlerts_UpdatePanelWeightAlerts > fieldset, #TabContainerAlerts_TabPanelTemperatureAlerts_UpdatePanelTemperatureAlerts > fieldset, #TabContainerAlerts_TabPanelOxygenAlerts_UpdatePanelOxygenAlerts > fieldset { border: 1px solid #7a8dab; border-radius: 10px; float: left; width: 81%; display: inline-block; margin-left: -5px; margin-top: 10px; margin-bottom: 10px; } #TabContainerAlerts_TabPanelBloodPressureAlerts_UpdatePanelBloodPressureAlerts > fieldset > legend, #TabContainerAlerts_TabPanelGlucoseAlerts_UpdatePanelGlucoseAlerts > fieldset > legend, #TabContainerAlerts_TabPanelWeightAlerts_UpdatePanelWeightAlerts > fieldset > legend, #TabContainerAlerts_TabPanelTemperatureAlerts_UpdatePanelTemperatureAlerts > fieldset > legend, #TabContainerAlerts_TabPanelOxygenAlerts_UpdatePanelOxygenAlerts > fieldset > legend { text-indent: 8px; display: inline-block; position: relative; top: -10px\\9; /* IE 8 and below */ } 
 <fieldset id="FieldSetAlertsBloodPressureSystolic"> <legend> Systolic <input id="TabContainerAlerts_TabPanelBloodPressureAlerts_CheckBoxBloodPressureSystolicAlertEnablement" type="checkbox" onclick="javascript:setTimeout('__doPostBack(\\'TabContainerAlerts$TabPanelBloodPressureAlerts$CheckBoxBloodPressureSystolicAlertEnablement\\',\\'\\')', 0)" checked="checked" name="TabContainerAlerts$TabPanelBloodPressureAlerts$CheckBoxBloodPressureSystolicAlertEnablement"></input> </legend> <div id="TabContainerAlerts_TabPanelBloodPressureAlerts_PanelBloodPressureSystolicAlerts"> <div id="DivBloodPressureSystolicAlertSection"> <div id="DivBloodPressureSystolicAlertNormalWrapper">…</div> <div id="DivBloodPressureSystolicAlertWarningWrapper">…</div> <div id="DivBloodPressureSystolicAlertCriticalWrapper">…</div> <div id="DivMultiSliderExtenderBloodPressureSystolicAlert">…</div> </div> </div> </fieldset> 

I'm trying to make everything look like it does in firefox, but I'm starting to think there is going to be no way IE will let me do that, especially with the alpha I am using in my bg. 我正在尝试使一切看起来都像在Firefox中一样,但是我开始认为IE绝不会允许我这样做,尤其是在bg中使用alpha时。

You can use the following css trick: 您可以使用以下CSS技巧:

fieldset > legend {
   height:30px; 
   position:absolute;
   margin-top:-10px;
   background:blue; 
}

The the height 30px is an example, and the blue should be replaced by the color of the tabs background. 高度30px是一个示例,蓝色应替换为标签背景的颜色。

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

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