css - Preventing buttons from moving on browser re size -
i quite new css apologies in advance.
i have simple problem: navigation buttons move whenever re size window. have googled @ least week , can't seem find solution. have managed make not move horizontally on re size, reason continue move vertically on window re size. not understand why happening! can help?! in advance.
here html
`<!doctype html> <html> <head> <meta charset="utf-8"> <title>untitled document</title> <link rel="stylesheet" href="css/experiment.css" type="text/css"> </head> <body> <div id= "wrapper"> <a href:"#" class= "button1"> home </a> <a href:"#" class= "button2"> </a> <a href:"#" class= "button3"> how works </a> <a href:"#" class= "button4"> pricing </a> <a href:"#" class= "button5"> contact </a> </div> </body> </html>
here css:
#wrapper { margin-left:auto; margin-right:auto; width:960px; } .button1 { display: block; position: absolute; bottom: 30px; left: 20px; border: #122a0a; border-style: solid; border-width: 9px; background-color: #122a0a; text-align: center; font-family: georgia,serif; color: #789d6c; margin: 0px auto; } .button2 { display: block; position: absolute; bottom: 30px; left: 170px; height: auto; width: auto; border: #122a0a; border-style: solid; border-width: 9px; background-color: #122a0a; text-align: center; font-family: georgia,serif; color: #789d6c; } .button3 { display: block; position: absolute; bottom: 30px; left: 320px; height: auto; width: auto; border: #122a0a; border-style: solid; border-width: 9px; background-color: #122a0a; text-align: center; font-family: georgia,serif; color: #789d6c; } .button4 { display: block; position: absolute; bottom: 30px; left: 510px; height: auto; width: auto; border: #122a0a; border-style: solid; border-width: 9px; background-color: #122a0a; text-align: center; font-family: georgia,serif; color: #789d6c; } .button5 { display: block; position: absolute; bottom: 30px; left: 660px; height: auto; width: auto; border: #122a0a; border-style: solid; border-width: 9px; background-color: #122a0a; text-align: center; font-family: georgia,serif; color: #789d6c; }
i trying make site no scroll bars. (just in case relevant)
your html markup wrong. has this:
<div id="wrapper"> <a href="#" class="button1">home</a> <a href="#" class="button2">about</a> <a href="#" class="button3">how works</a> <a href="#" class="button4">pricing</a> <a href="#" class="button5">contact</a> </div>
also, absolute positioning each navigation item worst , hardest way creat navigation menu. suggest @ few articles creating simple navigation menu. here few:
Comments
Post a Comment