While working on a responsive website with Magento v1.8, I encountered a challenge in making the header responsive. I attempted using div but couldn't get it to work as expected. Switching to the table method has brought me halfway there, but I'm still facing some issues.
My goal is to achieve the following layout:
[___Logo____][___Search_____][___Cart_____] (100% screen width)
When the resolution changes (mobile/table), it should transform into:
[___Logo_______]
[___Search_____]
[___Cart________]
Currently, the header collapses 3/4 of the way, and the cart overflows off the screen. When further shrinking the screen, they stack, but with misaligned elements.
Here is what I have done so far:
<style>
@media screen and (max-device-width: 600px), screen and (max-width: 600px) {
*[class=headermobilewrapper]{width:100%!important; height:auto!important;}
*[class=w320]{width:320px!important; height:auto!important;}
*[class=split]{width:320px!important; float:left!important; display:block !important;}
</style>
<?php $config = Mage::getStoreConfig('themessettings', $_GET['store']); ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="headermobilewrapper" align="center" bgcolor="#f3faf0">
<tr>
<td style="vertical-align:middle" class="split"> <a href="http://dev2"><img src="/images/header/header_logo.gif" ></a> </td>
<td style="vertical-align:middle" align="center" class="split"> <?php echo $this->getChildHtml('topSearch'); ?> </td>
<td style="vertical-align:middle" align="center" class="split"> <?php echo $this->getChildHtml('cartTop') ?> </td>
</tr>
</table>
I am open to changing formats, styles, etc., and have already explored various methods from Google and other sources. However, I seem to be missing something or perhaps the desired outcome is not achievable yet.