Html 调整模式条款和条件

Html 调整模式条款和条件,html,css,twitter-bootstrap,bootstrap-modal,Html,Css,Twitter Bootstrap,Bootstrap Modal,您好,我只是想问一下如何在模式弹出窗口中居中显示我的条款和条件中的文本。添加模式css以尝试将其居中似乎不起作用。谢谢任何能帮忙的人 HTML: 你的css .modal { width: 300px; height: 300px; margin-top: 100px; #add according to your requirement margin-left: auto; margin-right: auto;

您好,我只是想问一下如何在模式弹出窗口中居中显示我的条款和条件中的文本。添加模式css以尝试将其居中似乎不起作用。谢谢任何能帮忙的人

HTML:

你的css

.modal {
        width: 300px;
        height: 300px;
        margin-top: 100px; #add according to your requirement
        margin-left: auto;
        margin-right: auto;
        padding: 10px; # add if you want
       }

您可以添加转换:
translate(-50%,-50%);左:50%;最高:50%

.modal {
        width: 300px;
        height: 300px;
        top:50%;
        left: 50%;
        transform: translate(-50%, -50%);
        padding: 10px;
        position: absolute;
       }
.modal {
        width: 300px;
        height: 300px;
        margin-top: 100px; #add according to your requirement
        margin-left: auto;
        margin-right: auto;
        padding: 10px; # add if you want
       }
.modal {
        width: 300px;
        height: 300px;
        top:50%;
        left: 50%;
        transform: translate(-50%, -50%);
        padding: 10px;
        position: absolute;
       }