An absolute newbie to HTML. This is a layout issue. I have a title width 100% What I want to have a nav section for navigation, which should be 15% page, and the remaining 85% should display some content. Finishing a webpage with a footer .
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="generator" content="CoffeeCup HTML Editor (www.coffeecup.com)"> <meta name="dcterms.created" content="fr, 09 okt 2015 06:20:07 GMT"> <meta name="description" content=""> <meta name="keywords" content=""> <link rel="stylesheet" type="text/css" href="mateusz.css"> <title>Nowa strona</title> </head> <body> <div id = "header"> dada</div> <div id = "nav" class="container"> <h1> ma </h1> </div> <div id = "section" class="flex-column"> WTH </div> <div id = "footer"> M </div> </body> </html>
style:
body { margin:40px; padding:5px } #header { background-color:black; color:white; text-align:center; padding:5px; height:200px; width:100% } #nav { line-height:30px; background-color:#eeeeee; height:300px; width:15%; float:left; padding:5px; display:inline-block; } #section { float:left; background-color: red; width:85%; display:inline-block; padding:5px; } #footer { background-color:black; color:white; clear:both; text-align:center; padding:5px; width:100%; }
But I get what I interpret, since 15% and 85% are not 100% equal (WTH lower with respect to nav ? I tested 83%, but the correct one, but the "red" does not completely overlap with the header

What should I do to do it right?
source share