简体   繁体   English

HTML Dreamweaver左边距

[英]HTML Dreamweaver Left Margin

Im trying to create a website using dreamweaver but i am having a small problem with a margin being created on the left which is like a white gap.I have tried to set left margin to 0 using CSS but no luck 我试图使用dreamweaver创建一个网站,但我有一个小问题,在左边创建了一个空白,就像一个空白差距。我试图使用CSS将左边距设置为0,但是没有运气

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
.Header {
    background-attachment: scroll;
    background-color: #FFF;
    background-image: url(Background/images/images/Untitled-1_01.gif);
    background-size: cover;
    background-repeat: no-repeat;
    height: 48px;
    width: 100%;
    position: fixed;
    top: 0px;
    background-position: center;
    margin-left: 0px;
}
.Wrapper {
    background-color: #FFF;
    height: auto;
    width: auto;
    margin-left: 0px;
}
</style>
</head>

<body>
<div class="Wrapper">
<div class="Header"></div>
<div>
</div>
  <p>d sdsd </p>
  <p>&nbsp;</p>


</div>


</body>
</html>

The body of the page includes a browser default margin, so you should reset that value once you start editing your CSS, if you don't want to bump in later issues like this. 页面的正文包含浏览器的默认边距,因此,如果您不想在以后遇到此类问题,则应在开始编辑CSS时重置该值。

Copy the following to the top of you CSS file/tags: 将以下内容复制到CSS文件/标签的顶部:

html, body{
   margin: 0;
   padding: 0;
}

With that you can then remove the unnecessary updates on the margins that you've inserted to correct this problem. 这样,您就可以删除为解决此问题而插入的页边空白处不必要的更新。

may be it is Because of the default style of browser. 可能是因为浏览器的默认样式。 You can use reset.css or others like bootstrap.css to Clear browser css. 您可以使用reset.css或其他类似bootstrap.css的命令来清除浏览器CSS。 Hope this helps thanks 希望这可以帮助谢谢

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

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