October 4, 201214 yr I'm a scratching my head a little bit here! I'm trying to recreate this home page by stripping out the Flash elements for mobile and replacing them with CSS driven elements. I've turned to background images and using pseudos to create a rollover effect. To do this I need to create three different "panels". But the problem is, when I add the images to the page, they stack together right on top of each other rather than side by side the way it is currently which pushes down the flash element below even further. You try and position each of the panels into place using relative positioning and it does the job with an annoying side effect. As far as the HTML is concerned, the divs are still placed in the same position so the space is still taken up as if the elements haven't been applied for CSS. The only way I can position the panels as desired is to actually enclose the the CSS backgrounds in tables, which I know is not good practice and not what I want to end up doign in the long term. Is there a solution that I'm missing? :/ <style id = "" type = "text/css"> #valetingPanel { position: relative; width: 286px; height: 330px; background-image:url(images/p_valeting.png); } #detailPanel { position: relative; width: 286px; /*left: 300px; top: -330px;*/ height: 330px; background-image:url(images/p_detailing.png); } #carpetPanel { /**/ position: relative; width: 286px; /*left: 600px; top: -660px;*/ height: 330px; background-image:url(images/p_carpets.png); } #valetingPanel:hover, #detailPanel:hover, #carpetPanel:hover /**/ { background-position: -300px; } #panels { position: relative; left: 40px; width: 1000px; vertical-align:middle; text-align:center; }/**/ /*object#FlashID2 { position: absolute; top: -200px; }*/ </style> <div id = "panels"> <table> <!-- tables Arrrgh --> <tr> <td> <div id = "valetingPanel"> </div></td> <td> <div id = "detailPanel"> </div></td> <td> <div id = "carpetPanel"> </div></td> </tr> </table> </div>
October 4, 201214 yr Have you tried to use float: left; and float: right; ???? Seems the simplest way to do it then add a margin?? So: <style id = "" type = "text/css"> #valetingPanel { position: relative; float: left; width: 286px; height: 330px; background-image:url(images/p_valeting.png); } #detailPanel { position: relative; width: 286px; float: left; /*left: 300px; top: -330px;*/ height: 330px; background-image:url(images/p_detailing.png); } #carpetPanel { /**/ position: relative; width: 286px; float: right; /*left: 600px; top: -660px;*/ height: 330px; background-image:url(images/p_carpets.png); } #valetingPanel:hover, #detailPanel:hover, #carpetPanel:hover /**/ { background-position: -300px; } #panels { position: relative; left: 40px; width: 1000px; vertical-align:middle; text-align:center; }/**/ /*object#FlashID2 { position: absolute; top: -200px; }*/ </style> <div id = "panels"> <div id = "valetingPanel"> </div> <div id = "detailPanel"> </div> <div id = "carpetPanel"> </div> </div>
October 4, 201214 yr Author Problem solved!, thanks steveking. I admit using the floats didn't occur to me but using left for all 3 panels did the job.
October 4, 201214 yr haha thats ok mate, sometimes the simplest of solutions escape us all some time! I remember one of my first sites and I was testing it to make sure all functionality was there and was getting annoyed why the contact from wouldnt send. Rebuilt my php code 3 times to make sure there was nothing wrong. Then after 4 hours realised the php wont work and send email unless the site is on a live server lol!
October 4, 201214 yr Author haha I always underestimate my capacity to miss the obvious, goes with the territory for my brain. That's why I love doing this for myself.
October 4, 201214 yr The obvious is always where you look last. You start exploring the more technical side of things as it has more chance to mess up until you realise it was something so simple. Just helped a mate do some yahoo log in thing because his developers couldnt get it working. It was real simple, the file name was wrong so yahoo couldnt verify it. Im no expert but I see the obvious very easily sometimes lol!
Create an account or sign in to comment