In the CSS code below, it appears that the background of divTwo
has moved behind divOne
. But the content of divTwo
appears to have been le
This is something quite frequently met in just simple HTML. In you current code, you are not using any containers
, wrappers
or rows
. This leads for the elements to overlap, if you want them not to overlap, you should give them some positioning or padding. In the provided fiddle, I have added a padding
of 50 px for the divTwo
in order to increase it's box show it is seen better.
The main idea is that you never start simply writing code but carefully think about the positioning of each element on your webpage. A good practice would be to learn how to "stack" elements( That's how I call it, the term might not be correct). Another thing is that there are some certain front end frameworks which could teach you better by example how to do this.
Bootstrap, Zurb Foundation (But Bootstrap...I'm not sure how many people use Zurb)
Here's the JS Fiddle to see how exactly the div has changed:JS Fiddle