gwolff2005 Posted February 7, 2014 Share Posted February 7, 2014 Hi guys,I need your help please. i worked on my site and everything looks fine apart from two divs. They appear in IE and FF fine but not in Chrome (see picture attached).First picture show in FF and IE which is correct the second one in chrome. The red CIRCLES (not the square) are the problems. The code for the facebook div is: <div class="fb-share-button" div style="position:relative;top:-50px;left:690px;z-index:4; width:345px; float:right;" data-href="http://www.guntmarwolff.com" data-type="button_count"></div> </div> The code for the picture div is: <div style="position:relative;top:85px;left:0px;z-index:5000px;"><script type="text/javascript"> var imlocation = "images/"; var currentdate = 0; var image_number = 0; function ImageArray (n) { this.length = n; for (var i =1; i <= n; i++) { this[i] = ' ' } } image = new ImageArray(3) image[0] = 'main_ad3.jpg' image[1] = 'main_ad4.jpg' image[2] = 'main_ad5.jpg' var rand = 60/image.length function randomimage() { currentdate = new Date() image_number = currentdate.getSeconds() image_number = Math.floor(image_number/rand) return(image[image_number]) } document.write("<img src='" + imlocation + randomimage()+ "'>"); </script></div> What am I doing wrong?????Please help. Thanks!!!! Link to comment https://forums.phpfreaks.com/topic/286009-divs-are-displayed-differently-in-chrome-than-in-firefox-and-explorer/ Share on other sites More sharing options...
ginerjm Posted February 7, 2014 Share Posted February 7, 2014 At first glance I see the word "div" inside your very first <div> tag. What exactly is that? Link to comment https://forums.phpfreaks.com/topic/286009-divs-are-displayed-differently-in-chrome-than-in-firefox-and-explorer/#findComment-1468050 Share on other sites More sharing options...
ginerjm Posted February 7, 2014 Share Posted February 7, 2014 After further review - I also see that you have wrapped your JS code inside another div tag. People may have problems with my next, but I find it preferable to place my js within my html header tag and not intermingle it with my html code. You can do it I guess, but I fail to see why. Frankly, the div here serves no purpose at all. Link to comment https://forums.phpfreaks.com/topic/286009-divs-are-displayed-differently-in-chrome-than-in-firefox-and-explorer/#findComment-1468052 Share on other sites More sharing options...
gwolff2005 Posted February 11, 2014 Author Share Posted February 11, 2014 Hi guys thanks for your help. my divs were quite a mess. So I took the div completely out and voila... Thanks again!! Link to comment https://forums.phpfreaks.com/topic/286009-divs-are-displayed-differently-in-chrome-than-in-firefox-and-explorer/#findComment-1468541 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.