gpt4 book ai didi

html - 如何在不影响其余内容的情况下将特定内容居中?

转载 作者:太空宇宙 更新时间:2023-11-04 12:30:27 25 4
gpt4 key购买 nike

我对编程还很陌生,但到目前为止我已经沉迷其中了!在发布我自己的问题之前,我已经看过这个网站。我已经找到了我要找的部分内容,但在尝试了一些代码之后,它没有用,所以我想打破僵局并寻求帮助!

注意:我使用的是 Kompozer。

我尝试的尝试:我希望页眉和页脚全宽,同时保持其余部分居中。我还希望页脚下方的空白区域像页眉顶部一样全宽。看这个example .

与该网站相比,我的网站是居中的,但两边都有空白,页脚下方也有一些空白。我希望我说得够清楚,你能帮帮我!非常感谢!

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 上。

试试这个:

body {
padding:0;
margin:0;
}

或者这个..

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

关于html - 如何在不影响其余内容的情况下将特定内容居中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27698429/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com