I have an HTML page that is vertically divided up into 3 sections. The background of the top section is white. The background of the middle section is gray. And the bottom section is black. I want these background colors to stretch the entire width of the page, regardless of the user's screen resolution. I have this working.
I have some content that is 800px in width. I want this content horizontally centered in each of these sections. Unfortunately, I can't seem to get it to work. What am I doing wrong? Here is my code:
<div style="background-color:white;">
<div style="text-align:center;">
Welcome!
</div>
</div>
<div style="background-color:silver;">
<div style="text-align:center;">
Navigation
</div>
</div>
<div style="background-color:black;">
<div style="text-align:center;">
Some Text
</div>
</div>