I'm new to web design I have been trying to teach my self. For some reason I cant figure out how to get rid of the blank margins around my border with out having to change the whole pages background color. How do you do this? Margin Issues
<body>
<div class="header">
<div class="navigation">
<h1>
<img src="./Assets/Pictures/Title 1.png"
alt="HappyCloud">
<h2 id="search">
<div class="search">
<form class="form-wrapper-2 cf">
<input type="text" placeholder="Search
..." required>
<button type="submit">Search</button>
</form>
</div>
</h2>
</h1>
<h2 class="tags">
<a href="./Public/About Us.html"><img
src="./Assets/Pictures/About Us 1.png" alt="About Us"></a>
<a href="./Public/Contact Us.html"><img
src="./Assets/Pictures/Contact Us 1.png" alt="Contact Us"></a>
</h2>
<br>
</div>
</div>
<header>Custom Computers</header>
<p>pic</p>
</body>
.header{
position:relative;
text-align: center;
font-size: 20px;
border: 2px, hidden;
background-image:
url(../Assets/Pictures/14ae77a7dc694035b60ec6daa3ff138f.jpg);
background-size: cover;
margin: 0;
padding: 0;
}
I thought this would make the border clear the margins. I'm currently tying this in CSS. I have tried to do this in HTML as well
selector { declarations... }. Then to complete your question can you add the HTML code? Why? Because when your CSS is applied to the body of the page it should work. See: How to create a Minimal, Reproducible Examplemargin: 0; padding: 0;on the parent, or its parent, upto and including onbody.<body>element has a margin by default. To get rid of it, add a rulebody {margin: 0}to your CSS.