Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialyakov sachuk
4,768 PointsHow I can cancel the default browser's "Margin"?
For example: I've tag "<h1>" that has a background color, but its field has space between its border to the edge of the browser's window.
illustration:
html code. <h1>Yakov Sachuk,Web developer</h1>
css code:
h1 { background-color: grey; padding:7px; margin-left:0px; }
3 Answers
Steven Parker
231,248 PointsYou're probably seeing the default body margin. Try turning that off also:
body { margin: 0; }
Antonio De Rose
20,885 Pointsfor that purpose, developers use, a file like a reset.css, you can get that in this link https://meyerweb.com/eric/tools/css/reset/, copy it, create the file reset.css, moreover, make sure, you call this file before the style.css file
Steven Parker
231,248 PointsThat seems rather drastic, and some of the changes it makes might not be desirable. For example, you might not want to lose the ability to tell a paragraph from a new line.
yakov sachuk
4,768 PointsNice , through this file my codding be much easier. Thank you.
yakov sachuk
4,768 PointsSteven Parker "That seems rather drastic, and some of the changes it makes might not be desirable." thanks for your note ,I'll take attention for this.
yakov sachuk
4,768 Pointsyakov sachuk
4,768 PointsThank you,it was worked!