Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
168 views
in Technique[技术] by (71.8m points)

php - Magento header jumping

I have strange bug where while browsing through categories on the magento webshop header of the webshop changes height on different pages (http://shop.tvornica-snova.hr/index.php/)

Ie if you are on the homepage, and click on some of the categories the header extends for additinal 10px in height and kind of pushes the content down.

I seem to have same html structure and layout for the both homepage and categories so I cannot figure out where is the bug.

Can someone help?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Check out the header-top section of your markup for a normal page, and for the "jumping" page.

Normal:

<div class="logo">
    <strong>Magento Commerce</strong>
    <a href="http://shop.tvornica-snova.hr/index.php/" title="Magento Commerce" class="logo">
        <img src="http://shop.tvornica-snova.hr/skin/frontend/default/f002_yellow/images/logotvornica.png" alt="Magento Commerce">
    </a>
</div>

Jumping:

<a href="http://shop.tvornica-snova.hr/index.php/" title="Magento Commerce" class="logo">
    <strong>Magento Commerce</strong>
    <img src="http://shop.tvornica-snova.hr/skin/frontend/default/f002_yellow/images/logotvornica.png" alt="Magento Commerce">
</a>

The first one contains two references to class="logo", which has a defined rule of margin-top: -10px;. This is the case for any of your pages where the header is the closest to the top of the page - it is being pulled up by 20px

The second one is marked up slightly differently, and contains just one reference to the class - hence the 10px shift you see.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...