html - can't get buttons to be responsive and scale like the rest of my page -
i've got of page responsive thing can't seem figure out 2 buttons. using javascript mouseover effect not sure if messing things or not. want images scale along rest of page when view in different resolutions.
http://74.117.156.152/~pr0digy/
here html:
<!doctype html> <html lang="en"> <head> <title>us legal support - capex</title> <meta charset="utf-8" /> <link rel="stylesheet" href="style.css" type="text/css" /> <meta name="viewport" content="width-device-width, initial-scale-1.0"> <script type="text/javascript"> if (document.images) { new1 = new image; new2 = new image; existing1 = new image; existing2 = new image; new1.src = "images/new1.png"; new2.src = "images/new2.png"; existing1.src = "images/existing1.png"; existing2.src = "images/existing2.png"; } function swapimage(thisimage,newimage) { if (document.images) { document[thisimage].src = eval(newimage + ".src"); } } </script> </head> <body class="body"> <header class="mainheader"> <img src="images/uslegalbox.png" alt="usls box" > </header> <div class="textbox"> <div class="text"> <h1>capital</h1> <h2>expenditures</h2> </div> <div class="buttonsbox"> <div class="newcapex"> <a href="#" onmouseover="swapimage('new','new2')" onmouseout="swapimage('new','new1')"><img src="images/new1.png" class="ri" name="new" alt="new capex"></a> </div> <div class="capexstatus"> <a href="#" onmouseover="swapimage('existing','existing2')" onmouseout="swapimage('existing','existing1')"><img src="images/existing1.png" class="ri" name="existing" alt="check status" width="310px" height=$ </div> </div> </div> </body>
and css:
body { background: url('images/bg.jpg'); background-size: 100%; background-repeat:no-repeat; color: #000305; font-size: 87.5%; /* base font size 14px */ font-family: arial; 'lucida sans unicode'; text-align: left; width: 100%; margin: 0; padding: 0; height: 100%; } .mainheader { width: 30% height: auto; margin: 2% 0 0 -1%; } .mainheader img { width: 35%; height: 100%; } .textbox { height: 275px; margin-top: 3%; background-image: url('images/buttonsbox.png'); background-repeat: repeat-x; } .text { width: 40%; margin-left: 5%; float: left; margin-top: -1%; } .buttonsbox { width: 55%; float: right; margin-top: 50px; } .newcapex { float: left; border: 0; margin-top: 45px; } .capexstatus { margin-left: 50%; border: 0; margin-top: 45px; } .newcapex img { width: 100%; } /* text */ h1 { color: #ffffff; font-size: 5.0em; margin-top: 60px; } h2 { color: #ffffff; font-size: 5.0em; margin-top:-30px; }
first, remove absolute dimensions of images
<div class="buttonsbox"> <div class="newcapex"> <a href="#" onmouseover="swapimage('new','new2')" onmouseout="swapimage('new','new1')"> <img src="capex_arquivos/new1.png" class="ri" name="new" alt="new capex"> </a> </div> <div class="capexstatus"> <a href="#" onmouseover="swapimage('existing','existing2')" onmouseout="swapimage('existing','existing1')"> <img src="capex_arquivos/existing1.png" class="ri" name="existing" alt="check status"> </a> </div> </div>
second. set float property capex status , width of 40% both containers
.newcapex { float: left; border: 0; margin-top: 45px; width: 40%; } .capexstatus { float: right; border: o; margin-top: 45px; margin-right: 20px; width: 40%; }
third. put second image width 100% too.
.newcapex img, .capexstatus img { width: 100%; }
Comments
Post a Comment