解决JQeury显示内容没有边距内容紧挨着浏览器边线

前端技术 2023/09/05 JavaScript
写的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>

本文地址:https://www.stayed.cn/item/14406

转载请注明出处。

本站部分内容来源于网络,如侵犯到您的权益,请 联系我

我的博客

人生若只如初见,何事秋风悲画扇。