繁体   English   中英

如何在不影响其余内容的情况下集中显示特定内容?

[英]How do I center specific content without affecting the rest?

我对编程非常陌生,但到目前为止,我已经沉迷于此! 在发布我自己的问题之前,我已经查看了该网站。 我找到了我要找的部分内容,但是在尝试了一些代码之后,它没有用,所以我想到了破冰并寻求帮助!

注意:我正在使用Kompozer。

我尝试尝试的方法:我希望页眉和页脚为全角,同时保持其余部分居中。 我还希望页脚下方的空白区域像在页眉顶部一样具有全宽度。 请参阅此示例

与该网站相比,我的网站是居中的,但是每侧都有空白,并且页脚下方有一点空白。 希望我已经足够清楚,让您可以帮助我! 非常感谢!

 html, body { margin: 0; padding: 0; height: 100%; min-height: 100%; #wrap { margin: 0 auto; width: 1156px; } 
 <body> <div id="wrap"> <div id="headers"> <div id="left"> <div id="h1"> <div style="text-align: left;"> <div style="text-align: left;"> <img style="width: 27px; height: 27px;" alt="" src="images/phone-icon-hi.png" align="top" vspace="5">+1-844-Meb-Zone&nbsp;&nbsp; &nbsp;&nbsp; <img style="width: 27px; height: 27px;" alt="" src="images/icon-mail-grey-150x150.png" align="top" vspace="5">support@meb-zone.com <br> </div> &nbsp;</div> <br> </div> </div> <div id="right"> <div style="text-align: right;" id="h2"> <img style="width: 33px; height: 33px;" alt="" src="images/lightbulb-grey.png" align="top" vspace="5">Try Our Customer Rewards Program &amp; Save Money on every order! <img style="width: 33px; height: 33px;" alt="" src="images/lightbulb-grey.png" align="top" vspace="5"> <br> </div> </div> </div> <div id="menus"> <div id="left"> <div id="m1"> <div style="text-align: center;"> <div style="text-align: left;"> <img style="width: 384px; height: 76px;" alt="" src="logo/LGO2015_2.png" align="middle"> <br> </div> <br> </div> <br> <br> <br> <br> <br> </div> </div> <div id="right"> <br> </div> </div> <div id="navigations"> <div id="left"> <div style="text-align: center;" id="nav1"> <div style="text-align: left;">HomeStoreBlogContactFAQ <br> </div> <br> </div> </div> <div id="right"> <div style="text-align: right;" id="n2"> <img style="width: 18px; height: 18px;" alt="" src="images/user.png" align="top" vspace="5">My Account <img style="width: 18px; height: 18px;" alt="" src="images/basic1-136_heart_favorite_list-128.png" align="top" vspace="5">My wishlist <img style="width: 24px; height: 24px;" alt="" src="images/36.png" align="top" vspace="5">Checkout <img style="width: 21px; height: 21px;" alt="" src="images/checkout-empty-128.png" align="top" vspace="5">Cart <img style="width: 18px; height: 18px;" alt="" src="images/protection_lock-512.png" align="top" vspace="5">Login <br> <br> <br> </div> </div> </div> <div style="text-align: left;"> <img style="width: 289px; height: 289px;" alt="" src="images/260277245_f6dca38e3413.jpg"> <img style="width: 289px; height: 289px;" alt="" src="images/260277245_f6dca38e3413.jpg"> <img style="width: 289px; height: 289px;" alt="" src="images/260277245_f6dca38e3413.jpg"> <img style="width: 289px; height: 289px;" alt="" src="images/260277245_f6dca38e3413.jpg"> <br> </div> <br> <br> <br> <br> <div id="store_content"> <div id="left_st"> <div id="category">category left</div> </div> <div id="right_st"> <div id="products">products left</div> </div> </div> <div id="footers"> <div id="left"> <div style="text-align: center;"> <div style="text-align: left;">SERVICE <br>Contact Us <br>Blog <br>FAQ's <br>Customer Rewards Program <br> </div> <br> <br> <br> <br> <br> </div> </div> <div id="right"> <div style="text-align: right;" id="f2">ABOUT MEB ZONE <br>Shipping &amp; Payment <br>Terms Of Service <br>Return Policy <br>Privacy Policy <br>Company Information <br> </div> </div> </div> <div id="bottom_footer"> <br> <div style="text-align: center;"> Copyright © 2015 Meb Zone.com All rights Reserved. <br> </div> <br> </div> </div> </body> 

我认为您的问题出在身体上。

尝试这个:

body {
  padding:0;
  margin:0;
}

或这个..

<body style="margin:0; padding:0"> 
   (all your stuff here) 
</body>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM