Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 默认脚手架的样式设置_Css_Asp.net Mvc_Styling - Fatal编程技术网

Css 默认脚手架的样式设置

Css 默认脚手架的样式设置,css,asp.net-mvc,styling,Css,Asp.net Mvc,Styling,如何设置默认脚手架的样式(CSS),使标签和编辑器位于同一行(标签列具有固定宽度) @LabelFor(model=>model.Price) @EditorFor(model=>model.Price) @Html.ValidationMessageFor(model=>model.Price) 您可能需要调整宽度。边框仅在开发时用作参考 <style type="text/css"> .editor-label { float: left; border: 1

如何设置默认脚手架的样式(CSS),使标签和编辑器位于同一行(标签列具有固定宽度)


@LabelFor(model=>model.Price)
@EditorFor(model=>model.Price)
@Html.ValidationMessageFor(model=>model.Price)

您可能需要调整宽度。边框仅在开发时用作参考

<style type="text/css">

.editor-label {
    float: left;
    border: 1px solid red;
    width: 200px;
    margin-bottom: 4px;
    }

.editor-field {
    float: left;
    width: 400px;
    border: 1px solid green;
    }

.editor-label:before {
    clear: left;
    }

</style>

.编辑标签{
浮动:左;
边框:1px纯红;
宽度:200px;
利润底部:4倍;
}
.编辑字段{
浮动:左;
宽度:400px;
边框:1px纯绿色;
}
.编辑标签:之前{
清除:左;
}

我将其复制/粘贴到样式表中,但clear:left似乎没有生效。我在IE 8和Chrome 9中试用过。当标签宽度为400px,字段宽度为500px时,一切看起来都很酷
<style type="text/css">

.editor-label {
    float: left;
    border: 1px solid red;
    width: 200px;
    margin-bottom: 4px;
    }

.editor-field {
    float: left;
    width: 400px;
    border: 1px solid green;
    }

.editor-label:before {
    clear: left;
    }

</style>