<div id="content">
<div id="main">
<div id="text">
<div id="hw_container">
<p id="p1">Hello</p>
<p id="p2"> World!</p>
</div>
<h1 id="im">I'm something</h1>
<div id="typewriter_container">
<h1 id="typewriter"></h1>
</div>
<a href="#" id="something">something</a>
</div>
<div id="something"><img src="something"div>
</div>
</div>
<div id="footer">
<div id="nav">
<a href="something" id="contact"></a>
<ul>
<li><a id="selected">something</a></li>
<li><a href="#">something</a></li>
<li><a href="#">something</a></li>
</ul>
<div id="something"></div>
</div>
</div>
Here is the part of code, and when im running my code, its showing my footer IN the content block. I don’t know why. Stack overflow is blocking my screenshots, but i’ll still upload one: https://prnt.sc/u8KxH_ZZuUZ8
So i tried reloading my code, vs code, browser and pc. I also tried rewriting code and running it in another browser. Nothing helps.
2
Answers
Try the code given below:
hope it helps:)
It is good to use semantics when working with HTML, for your case you would have used:
always make sure not to include the footer inside the main tag.
With this approach to have the footer at the bottom and help by default, you can use the display grid as in the snippet, I’ve written below
I hope this helps or you can just modify your code by moving the
#footer
out of the#content
div. With the approach I shared, it is not a must for the CSS to be written under the body tag but on the parent container.I hope this helps, Happy Coding Happy Hacking👩🏻💻🦾💡