如何修复div中按钮的对齐中心? [英] how to fix the alignment center for button in div?

查看:80
本文介绍了如何修复div中按钮的对齐中心?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将这些样式用于我的按钮,这些按钮包含在我的div中,但是这些样式并没有在中心对齐所以请提供解决方案以解决问题
/>


Css ----------------------------------- ---

I have used these styles to my buttons which are included in my div

but those are not aligned in center so please provide the solution for resolve it

Css--------------------------------------

.OcDivLeftBtnContainer_50 {
float:left;
width:50%;
height:25px;
margin:auto;
margin-bottom:10px;
}
.OcDivRightBtnContainer_50 {
float:left;
width:50%;
height:25px;
margin:auto;
margin-bottom:10px;
padding-left:10px;
}

.OcDivflaotright_10 {
    float:right;
width:10%;
    height: 25px;
}
.OcDivflaotleft_10 {
 float:left;
width:10%;
}











----------------------------- ---------------------------






--------------------------------------------------------

<div class="OcDivLeft_100_Button">

                        <div class="OcDivLeftBtnContainer_50" >
                            <div class="OcDivflaotright_10">
                            <dx:ASPxButton ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click">
                            </dx:ASPxButton>
                        </div>


                        </div>
                        <div class="OcDivLeftBtnContainer_50">
                            <div class="OcDivflaotleft_10">
                                 <dx:ASPxButton ID="btnCancel" runat="server" Text="Cancel">
                            </dx:ASPxButton>
                                </div>


                        </div>



                    </div>















Asp.net按钮和div








Asp.net buttons and div

推荐答案

float:left;

float:right;

替换为

text-align: center;


这篇关于如何修复div中按钮的对齐中心?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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