样式属性不起作用 [英] Style attribute is not working

查看:101
本文介绍了样式属性不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

@ Html.LabelFor(m => m.ParticipantResultId,new {style =width:232px;})





可以任何人请帮助我样式属性不使用标签。

@Html.LabelFor(m => m.ParticipantResultId,new {style = "width:232px;"})


can anybody please help me style attribute is not working with label.

推荐答案

@Html.LabelFor(m => m.ParticipantResultId,new {style = "display: inline-block;;width:232px;"})



< label> element不会接受FireFox中的宽度值,我只花了太长时间找到一个解决方法。 label元素用于将文本标签与不自动标签的表单控件相关联。



简答:浮动左侧使宽度适用于标签元素。



为label标签指定宽度时,宽度值在Internet Explorer中有效。 FireFox忽略了我在CSS文件中分配给标签HTML标签的宽度(以像素为单位)。


The <label> element will not accept a width value in FireFox, and I just spent way too long finding a workaround. The label element is used to associate a text label to a form control that does not automatically have a label.

Short answer: float left makes width work on label elements.

When assigning a width to the label tag, the width value worked in Internet Explorer. FireFox disregarded the width in pixels that I assigned to the label HTML tag in my CSS file.


这篇关于样式属性不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆