Edit: Whoops, meant to say "need HELP with fixed width layout"
I'm definitely new at coding and this problem has been plaguing me for days and I decided I needed help. In learning how to layout pages, I created a test page and cannot figure out why the "middle" and "right" portions of the code are appearing at the bottom of the "left" portion.
Here is the CSS
Here is the HTML:
Thanks in advance!
I'm definitely new at coding and this problem has been plaguing me for days and I decided I needed help. In learning how to layout pages, I created a test page and cannot figure out why the "middle" and "right" portions of the code are appearing at the bottom of the "left" portion.
Here is the CSS
Code:
body { background-color: rgb(59,61,69); font-family: Georgia, Verdana, TimesNewRoman, Serif; font-size: larger; color: White; } div { padding: 10px; } h1 { font-family: 'Cantarell'; text-align: center; font-size: 275%; color: white; background-color: rgb(95,135,168); border-style: solid; border-color: black; border-width: 3px; } .body { width: 800px; margin-left: auto; margin-right: auto; } .left { float: left; width: 100px; background-color: orange; border-width: 2px; border-style: solid; border-color: black; margin: 8px; font-weight: bold; color: white; text-align: center; clear: both; } .middle { float: left; width: 450px; text-align: center; } .right { float: left; width: 100px; font-weight: bold; }
Code:
<!DOCTYPE html> <html> <head> <title>Fixed width layout</title> <link rel="stylesheet" href="stylesheet.css"/> </head> <body> <h1> test website, centered, fixed width layout </h1> <br/> <div class="body"> <div class="left"> <p> NAV BOX ONE</p> </div> <div class="left"> <p> NAV BOX TWO</p> </div> <div class="left"> <p> NAV BOX THREE</p> </div> <div class="middle"> <P> Can someone tell me why THIS section is not lining up at the top of the page with the yellow boxes? </P> </div> <div class="right"> Place an advertisement here </div> </div> </body> </html>
Comment