gpt4 book ai didi

php - php页面中左上角和右上角的奇怪边距

转载 作者:太空宇宙 更新时间:2023-11-04 02:00:06 24 4
gpt4 key购买 nike

大家好,我正在使用 bootstrap 构建一个 php 网页,我在 body 的顶部、右侧和左侧都有边距。正在关注this问题 我下载了 notepad++ 并转换为没有 BOM 的 utf-8,但边距仍然存在。

这是我的CSS文件

  .texts{
color: white;
}

.mainbody{
margin-top: 0;
max-width: 1200px;
}
.banner{
height : 600px;
width : 100%;
max-width:100%;
background-image: url("restrooms.jpg");
background-size: cover;
background-repeat: no-repeat;
}

.bannertext{
color: white;

}
.bannerbg{
background-color: #a52f0b;
opacity: 0.7;
margin-left: 40px;
height :150px

}
.dashform{
margin-top: 10px;
margin-bottom: 10px;
border-style: solid;
border-width: 1px;
}
.mtop{
margin-top: 6px;
}
.blbc{
background-color: #424242;


}
.im-centered{margin: auto; max-width: 100%;}

这里是index.php

 <?php
include ('header.html');
?>
<div class="w3-container w3-center">
<div class="w3-container banner">
<div class="w3-container w3-display-left bannerbg">
<h2 class="w3-container bannertext">Βρες το κατάλληλο εστιατόριο<br>.....στην κατάλληλη τιμή</h2>
<button class="w3-btn w3-red w3-round-xxlarge">Βρές Εστιατόριο</button>

</div>
</div>
</div>
</body>
</html>

header.html

  <!DOCTYPE html PUBLIC "-//W3C// DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/html1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang:"en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css"/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="rules.css"/>
<title>Αρχική</title>
<style type="text/css" media="print">
@page
{
size: auto; /* auto is the initial value */
margin: 0mm; /* this affects the margin in the printer settings */
}

</style>
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php">Δυναμικό Τιμολόγιο</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-right">
<li class="active"><a href="index.php">Αρχική</a></li>
<li><a href="#">Ολα Τα Καταστήματα</a></li>
<li><a href="login.php"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
</ul>
</div>
</div>
</nav>

这是输出的截图

enter image description here

我错过了什么?

最佳答案

body 在所有浏览器上都有默认边距,因此您需要做的就是将它们剃掉:

html,
body {
margin: 0;
padding:0;
text-align: center;
}

关于php - php页面中左上角和右上角的奇怪边距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41915298/

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