Click here to Skip to main content
16,004,647 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,

I have created one master page in that page using mobile jquery . page contain header, content and footer.In header I have used four image button and inside header I want to display menu name in between the image. i tried div inside one asp.net label control.I used text align and vertical align and line height attribute also but the text is not center in browser and mobile device aslo. please can any one help me. thanks for advance reply.

Css
CSS
.HeaderLine1
{
    color: #00264D;
    font-size:medium;
    font-family: Arial Narrow;
    font-weight: bold;
    padding-left: 0px;
}


html code

<form id="form1"  runat="server">
<div data-role="page">
    <div data-role="header" class="page">
        <div id="Div1" style="float: left; width: auto; border: 1px solid #300;">
            <div id="Div2"  runat="server" style="width: auto; height: auto; float: left; text-align: center;
                position: relative; margin: 0 auto;">
                <asp:label id="LblApplication" runat="server" cssclass="HeaderLine1" text="Jail Management System" style="vertical-align: middle;
                    line-height: 25px;">
            </div>
        </div>
    </div>

<div data-role="content">
    <asp:contentplaceholder id="MainContent" runat="server" />
</div>

</form>
Posted
Updated 18-Nov-13 1:09am
v4
Comments
JoCodes 18-Nov-13 7:17am    
why so many Container Divs with a float left?

1 solution

You can remove the
float: left;
style attribute so it will be placed in the center.

Also , Set the Vertical align to center in the immediate container Div which contains the label.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900