Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/14.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 - Fatal编程技术网

关闭按钮css位置

关闭按钮css位置,css,asp.net-mvc,Css,Asp.net Mvc,我有一个底部有一个关闭按钮的模式。它似乎是上下移动取决于顶部评论部分的长度。无论评论部分有多长,我都试图将其固定在底部。所以我用了relative,但若你们有更好的想法来解决这个问题,我会很感激的。谢谢 视图: <div class="form-horizontal"> <div class="modal-title title"> <p>@ViewBag.name<span> Info</span></p

我有一个底部有一个关闭按钮的模式。它似乎是上下移动取决于顶部评论部分的长度。无论评论部分有多长,我都试图将其固定在底部。所以我用了relative,但若你们有更好的想法来解决这个问题,我会很感激的。谢谢

视图:

<div class="form-horizontal">
    <div class="modal-title title">
        <p>@ViewBag.name<span> Info</span></p>
    </div>
    <div id="info">
        <p>@Html.Label("Name: ") @ViewBag.name</p>
        <p>@Html.Label("Age: ") @ViewBag.age</p>
        <p>@Html.Label("Comment: ") @ViewBag.comment</p>
    </div>
    <div id="close">
        <div class="col-md-12">
            <input type="button" id="closeButton" value="Close" class="btn btn-default" />
        </div>
    </div>
</div>

只要添加位置:固定,并下沉到底部,如果这是你想要的

#close {
    position: fixed;
    bottom: 0px;
    left: 50%;
}

只要添加位置:固定,并下沉到底部,如果这是你想要的

#close {
    position: fixed;
    bottom: 0px;
    left: 50%;
}

只是给了模态主体固定的高度,这样主体就可以在不改变按钮位置的情况下滚动

enter code h

引导示例
模态示例
开放模态
&时代;
模态头
@Html.Label(“Name:”)@ViewBag.Name

@Html.Label(“Age:”)@ViewBag.Age

@Html.Label(“Comment:”)@ViewBag.Comment


只是给了模态主体固定的高度,这样主体就可以在不改变按钮位置的情况下滚动

enter code h

引导示例
模态示例
开放模态
&时代;
模态头
@Html.Label(“Name:”)@ViewBag.Name

@Html.Label(“Age:”)@ViewBag.Age

@Html.Label(“Comment:”)@ViewBag.Comment


是的,但这取决于屏幕大小(例如:如果我按F11键将其设置为全屏),它会跳出框外。我怎样才能使按钮粘在模态的底部,而不管屏幕分辨率如何?我从小提琴上按f11,我仍然能在底部看到它是的,但这取决于屏幕大小,(例如:如果我按f11使其全屏显示),它会跳出框外。我怎样才能使那个按钮粘在模态的底部,而不管屏幕分辨率如何?我从小提琴上按了f11,我仍然能在底部看到它