I have the following code, for instance:
JSFiddle: http://jsfiddle.net/ntcg3/4/
HTML:
<html>
<p class="hey">hi</p>
</html>
CSS:
.hey {
width:100%;
background-color:red;
margin:0;
padding:0;
}
There is still a bit of padding on the right side of the page.
How can I get rid of that padding so the red background color extends to the very end of the page?
When you create an HTML page by default the
<body>and some other elements like paragraph tags (<p>), heading tags (<h1>,<h2>..<h6>) etc… has defaultpaddingandmarginsSo you need to clear those margin by adding following css:
For further details see CSS RESET
An example of a CSS Reset: