0

So my current div doesn't fit the webpage.. Both width and height is set to 100% and no padding is active..
https://i.stack.imgur.com/syq2U.jpg

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" type ="text/css" href="style4.css"/>
    <meta charset="UTF-8">
</head>
<body>
   <div class=Topbar>
        </div>

CSS:

.Topbar{ 
height:5vh;
width:100vw;
background-color:red;
padding:-3;
overflow-x:hidden;
overflow-y:hidden;
}
Drax
  • 141
  • 8
  • _"and no padding is active"_ - most certainly padding and/or margin on the html and/or body elements are "active", applied via the browser stylesheet. You need to explicitly set them to 0. – CBroe Oct 29 '16 at 21:29
  • 1
    @CBroe is right. Just set `margin: 0`on your body. – Aer0 Oct 29 '16 at 21:31
  • have a look previous answer : http://stackoverflow.com/a/25225716/4426282 – monikapatelIT Oct 29 '16 at 21:34

2 Answers2

2

Use the following style to remove the space.

body{ margin:0; }

-3

Web pages default leave a space on the right