JQeury顯示內容沒有邊距怎麼辦?

寫的JQuery頁面顯示的內容沒有邊距,內容緊挨着瀏覽器邊線,特別難看(如下圖)








代碼如下:

<body>
    <form id="form1" runat="server">
    <div data-role="page" id="page">
        <div data-role="header" data-theme="b">
            <h2>新聞內容</h2>
        </div>

        <div>
            <div>
                <asp:Image ID="newsImage" runat="server" AlternateText="新聞圖片" />
            </div>
            <div>
                <asp:Label ID="lblDetail" runat="server" Text="Label"></asp:Label>
            </div>
        </div>

        <div data-role="footer" data-theme="d">
            <h4>餐飲諮詢</h4>
        </div>
    </div>
    </form>
</body>
其實原因特別簡單,就是顯示的內容沒有放在content裏邊,所以在div里加一個data-role="content"就可以了,修改後的代碼如下:

<body>
    <form id="form1" runat="server">
    <div data-role="page" id="page">
        <div data-role="header" data-theme="b">
            <h2>新聞內容</h2>
        </div>

        <div>
            <div>
                <asp:Image ID="newsImage" runat="server" AlternateText="新聞圖片" />
            </div>
            <div>
                <asp:Label ID="lblDetail" runat="server" Text="Label"></asp:Label>
            </div>
        </div>

        <div data-role="footer" data-theme="d">
            <h4>餐飲諮詢</h4>
        </div>
    </div>
    </form>
</body>



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章