2016-07-08 186 views
0

目前正在一個網站上工作,整個過程中我一直在與背景圖像拼搏。我認爲這可能是由側邊欄以某種方式引起的(我創建的第一個網站有一個側邊欄)。 現在它有一些奇怪的原因,它周圍有一個白色的邊框。圍繞圖像的白色邊框

下面是一個圖像https://gyazo.com/d81f071f3e0d5b18020485565271557b

@font-face { 
 
    font-family: 'source_sans_prolight'; 
 
    src: url(font1/sourcesanspro-light-webfont.woff2) format("woff2"), url(font1/sourcesanspro-light-webfont.woff) format("woff"); 
 
    font-weight: 400; 
 
    font-style: normal; 
 
} 
 
@font-face { 
 
    font-family: 'open_sansregular'; 
 
    src: url(font2/opensans-regular-webfont.woff2) format("woff2"), url(font2/opensans-regular-webfont.woff) format("woff"); 
 
    font-weight: 400; 
 
    font-style: normal; 
 
} 
 
@font-face { 
 
    font-family: 'edoregular'; 
 
    src: url(font3/edo-webfont.woff2) format("woff2"), url(font3/edo-webfont.woff) format("woff"); 
 
    font-weight: 400; 
 
    font-style: normal; 
 
} 
 
.sidebar { 
 
    width: 200px; 
 
    height: 100%; 
 
    background-color: #212121; 
 
    top: 0; 
 
    left: 0; 
 
    position: fixed; 
 
    -webkit-box-shadow: 4px 0px 35px 2px rgba(0, 0, 0, 0.75); 
 
    -moz-box-shadow: 4px 0px 35px 2px rgba(0, 0, 0, 0.75); 
 
    box-shadow: 4px 0px 35px 2px rgba(0, 0, 0, 0.75); 
 
} 
 
.logo { 
 
    width: 180px; 
 
    padding: 30px 10px 50px; 
 
    border-bottom: 1px solid #2A2A2A; 
 
} 
 
.menu ul { 
 
    list-style-type: none; 
 
    margin: 0; 
 
    padding: 0; 
 
} 
 
.menu li a { 
 
    display: block; 
 
    padding: 10px 0; 
 
    border-bottom: 1px solid #2A2A2A; 
 
    color: #fff; 
 
    text-decoration: none; 
 
    text-align: center; 
 
    font-family: source_sans_prolight; 
 
    font-size: 17px; 
 
    transition: opacity .15s ease-in-out; 
 
    -moz-transition: background-color .15s ease-in-out; 
 
    -webkit-transition: background-color .15s ease-in-out; 
 
} 
 
.menu li a:hover { 
 
    background-color: #fff; 
 
    color: #000; 
 
} 
 
.midheader { 
 
    margin: 0 auto; 
 
    width: 180px; 
 
    height: 25px; 
 
    padding-top: 30px; 
 
} 
 
.midheader h1 { 
 
    font-family: edoregular; 
 
} 
 
.midheader p { 
 
    font-family: open_sansregular; 
 
    font-size: 13px; 
 
    text-align: justify; 
 
    color: #fff; 
 
} 
 
.button1 { 
 
    background-color: #3AC6F4; 
 
    border: none; 
 
    color: #fff; 
 
    width: 180px; 
 
    height: 50px; 
 
    font-family: edoregular; 
 
    font-size: 20px; 
 
    -webkit-box-shadow: 0 3px 5px -2px rgba(0, 0, 0, 0.75); 
 
    -moz-box-shadow: 0 3px 5px -2px rgba(0, 0, 0, 0.75); 
 
    box-shadow: 0 3px 5px -2px rgba(0, 0, 0, 0.75); 
 
    -moz-transition: background-color .15s ease-in-out; 
 
    -webkit-transition: background-color .15s ease-in-out; 
 
} 
 
.button1:hover { 
 
    background-color: #fff; 
 
    color: #000; 
 
} 
 
.content1 { 
 
    background-image: url(images/firstimgbk.svg); 
 
    height: 1080px; 
 
    outline: none; 
 
} 
 
.title { 
 
    margin: 0 auto; 
 
    width: 850px; 
 
    padding-left: 200px; 
 
    font-family: edoregular; 
 
    font-size: 100px; 
 
    padding-top: 180px; 
 
    text-align: center; 
 
    color: white; 
 
    text-shadow: 2px 5px #292929; 
 
} 
 
.title p { 
 
    font-size: 40px; 
 
    text-shadow: 5px 2px #292929; 
 
} 
 
.arrow { 
 
    left: 50%; 
 
    bottom: 10px; 
 
    position: absolute; 
 
    width: 100px; 
 
    padding-left: 50px; 
 
    -moz-transition: -webkit-filter .15s ease-in-out; 
 
    -webkit-transition: -webkit-filter .15s ease-in-out; 
 
} 
 
.arrow:hover { 
 
    -webkit-filter: drop-shadow(0px 2px 2px black); 
 
} 
 
.content2 { 
 
    height: 1080px; 
 
    background-color: white; 
 
} 
 
.footer { 
 
    margin: 0 auto; 
 
    position: fixed; 
 
    bottom: 20px; 
 
    padding: 20px; 
 
    height: 20px; 
 
    font-family: open_sansregular; 
 
    font-size: 13px; 
 
    color: #fff; 
 
    border-top: 1px solid #2A2A2A: 
 
}
<!DOCTYPE html> 
 
<html> 
 

 
<head> 
 
    <meta content="width=device-width, initial-scale=1.0" name="viewport"> 
 
    <link href="css/style.css" rel="stylesheet"> 
 
    <link href="css/images/favicon.ico" rel="shortcut icon"> 
 
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> 
 
    <title>Loom | Home</title> 
 
</head> 
 

 
<body> 
 
    <a id="home" name="home"></a> 
 
    <div class="sidebar"> 
 
    <div class="logo"> 
 
     <a href="index.html"> 
 
     <img alt="Logo" src="css/images/exloomd&c.svg"> 
 
     </a> 
 
    </div> 
 
    <div class="menu"> 
 
     <ul> 
 
     <li> 
 
      <a href="#home">Home</a> 
 
     </li> 
 
     <li> 
 
      <a href="index.html">About</a> 
 
     </li> 
 
     <li> 
 
      <a href="index.html">Portfolio</a> 
 
     </li> 
 
     <li> 
 
      <a href="index.html">Contact</a> 
 
     </li> 
 
     </ul> 
 
    </div> 
 
    <div class="midheader"> 
 
     <p>Check out my new website where our goal is to provide the cheapest most requested products!</p> 
 
     <button class="button1">ExLoom Market 
 
     </button> 
 
    </div> 
 
    <div class="footer"> 
 
     <div class="footer"> 
 
     ©2016 ExLoom. 
 
     <br>All Rights Reserved. 
 
     </div> 
 
    </div> 
 
    </div> 
 
    <div class="content1"> 
 
    <div class="title"> 
 
     hello 
 
     <p>hello</p> 
 
    </div> 
 
    <div class="arrow"> 
 
     <img src="css/images/arrowdown.svg"> 
 
    </div> 
 
    </div> 
 
    <div class="content2"> 
 
    hej 
 
    </div> 
 
</body> 
 

 
</html>

+0

需要鏈接或截圖請 –

+0

你可以創建一個http://jsfiddle.net? – ggdx

+0

用圖像編輯線程:) – loomanleet

回答

3

默認情況下,大多數瀏覽器給<body>元保證金。刪除它:

body { 
    margin: 0; 
} 
+1

像魅力一樣工作,謝謝:) – loomanleet