layout issue with different browsers

不想你离开。 提交于 2019-12-11 08:32:51

问题


I have a website, that works totally fine with FireFox (both desktop and android versions). but when I switch to another browser, the problems keep popping. check my homepage:

http://pichak-gallery.com

the header is well placed in firefox, but when you open the page in chrome,the header is not at its place. so I have to add this:

margin-top:-16px

but this will break the website in firefox. I don't even say that website is totally broken in IE.

another problem belongs to Google+1 button. that doesnt show up in chrome,until you press F12 and open inspect elements, then the button will show itself.

for example in this page:

http://pichak-gallery.com/index.php/7-maincategory/5-gallery.html

this will happen:

I worked on the codes for a long time, to investigate the problem. but I can't find any problem in the codes.

Have anyone else experienced these? Is there a code or script to be able to fix these?


回答1:


One thing I've noticed while viewing page source in FF is that you have an incorrect script tag as shown here (in red), between head and body tags.

So, I'm guessing that's the problem why you're getting this kind of rendering layout in Chrome

All your link and script tags somehow get inside body, and you have empty "div". The moment I deleted that node in the inspector, the problem disappeared. So, try erasing that <script type="text/javascript"> ; </script> or move it inside head.




回答2:


ok now i got it.

the 1st problem was because of a few lines from java template. starting with :

<?php
defined('_JEXEC') or die;

JHtml::_('behavior.framework', true);

$app = JFactory::getApplication();
?>

as far as i know these lines are for some security reasons, and i didnt think they will have any effect on layout since they dont echo anything.

the 2nd problem was about the custom line i added into my css. i manually overrided the original styles of google+1 button with !important tags, which it made problem with some browser. i had to put g+1 button in a DIV, then add those style to the mentioned DIV.



来源:https://stackoverflow.com/questions/25347699/layout-issue-with-different-browsers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!