shortysbest Posted January 30, 2011 Share Posted January 30, 2011 I attached a photo of what's going on. on the left is Safari, and the right is Firefox. Even just images aren't loading. such as: <img src="assets/logo.png" /> If i set the size on it however it shows a big white box for the size that it is defined. The same problem with background images, and I'm using this css for background images: background-image: url(../assets/buttons.png); (the ../ does have to be there, it's not that). background images do show for like :hover and :active and such, just not when you load the page. (images are on in safari preferences). this same problem is safari and chrome. [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/226141-safari-and-chrome-not-displaying-imagesbackground-images-firefoxie-does/ Share on other sites More sharing options...
cssfreakie Posted January 31, 2011 Share Posted January 31, 2011 - since your using an image as a background. we might want to know the css properties of the element to which the background is applied. (maybe also add if it should be repeated (and don't forget the space) - concernin g the in-line image:you ommited the alt=" " tag inside the image element. Quote Link to comment https://forums.phpfreaks.com/topic/226141-safari-and-chrome-not-displaying-imagesbackground-images-firefoxie-does/#findComment-1167619 Share on other sites More sharing options...
shortysbest Posted January 31, 2011 Author Share Posted January 31, 2011 concerning the alt="" tag for the image element, I have that in my code for my site, and even that doesn't show up in safari. In response to the css code, this would be the css I am using for the two black buttons (black in firefox, white in safari), along with the active image for the buttons (which show and everything when you click on the buttons) .button { background-image: url(../assets/buttons.png); background-repeat: repeat-x; color: #FFF; border: 1px solid #000; padding-top: 5px; padding-right: 12px; padding-bottom: 5px; padding-left: 12px; cursor: pointer; font-family: Verdana, Geneva, sans-serif; font-size: 11px; text-decoration: none; background-position: top; text-align: center; display: block; background-color: #333; } .button:active , .share:active{ background-image: url(../assets/navigationback-active.png); background-repeat: repeat-x; } Quote Link to comment https://forums.phpfreaks.com/topic/226141-safari-and-chrome-not-displaying-imagesbackground-images-firefoxie-does/#findComment-1167633 Share on other sites More sharing options...
haku Posted January 31, 2011 Share Posted January 31, 2011 Issues like this are easiest to debug with a link to the actual site. Quote Link to comment https://forums.phpfreaks.com/topic/226141-safari-and-chrome-not-displaying-imagesbackground-images-firefoxie-does/#findComment-1167652 Share on other sites More sharing options...
shortysbest Posted January 31, 2011 Author Share Posted January 31, 2011 www.kithell.com (the pink areas in Safari are where there should be a background image, which you can see if you view it in firefox) Quote Link to comment https://forums.phpfreaks.com/topic/226141-safari-and-chrome-not-displaying-imagesbackground-images-firefoxie-does/#findComment-1167659 Share on other sites More sharing options...
cssfreakie Posted January 31, 2011 Share Posted January 31, 2011 here you are, some things i changed but the effect and idea are the same: <style type="text/css"> input.coolbutton { background:transparent url(assets/yourimage.png) repeat-x top; /* don't give a background color since it will screw up your image */ color: #FFF; border: 1px solid #000; padding: 5px 12px; /* made this shorter */ cursor: pointer; font-family: Verdana, Geneva, sans-serif; font-size: 11px; text-decoration: none; text-align: center; /* removed display block */ } input.coolbutton:active {/* i don't know what that share class was for */ background-image: transparent url(assets/navigationback-active.png) repeat-x; } </style> <title></title> </head> <body> <input class="coolbutton" type="button" value="my-button" name="my-button" /> </body> I made the code a little shorter, but the above wrked for me. ( i recommend an external style sheet though Quote Link to comment https://forums.phpfreaks.com/topic/226141-safari-and-chrome-not-displaying-imagesbackground-images-firefoxie-does/#findComment-1167660 Share on other sites More sharing options...
shortysbest Posted January 31, 2011 Author Share Posted January 31, 2011 That exact code that you just gave me doesn't work for my safari.. :| I have safari 5.0.3 Quote Link to comment https://forums.phpfreaks.com/topic/226141-safari-and-chrome-not-displaying-imagesbackground-images-firefoxie-does/#findComment-1167663 Share on other sites More sharing options...
cssfreakie Posted January 31, 2011 Share Posted January 31, 2011 well i bet that is because I didn't see the html, that's also why i removed the display block but it seems you use an anchor element for this so it's needed than. and that's why i used input.class. maybe adjust it a bit to your needs? btw this works in chrome! a.button { background: transparent url(../assets/buttons.png) repeat-x; border: 1px solid black; color: white; cursor: pointer; display: block; font-family: Verdana, Geneva, sans-serif; font-size: 11px; padding: 5px 12px; text-align: center; text-decoration: none; } -edit if this doesn't work, in safari, maybe add a width or something not sure if that works, but you never know Quote Link to comment https://forums.phpfreaks.com/topic/226141-safari-and-chrome-not-displaying-imagesbackground-images-firefoxie-does/#findComment-1167665 Share on other sites More sharing options...
cssfreakie Posted January 31, 2011 Share Posted January 31, 2011 I hope the above helps the error is in your background-xxx stuff, try the short hand i showed. or: background: transparent url("../assets/buttons.png") repeat-x ; and don't give a color to the background. Quote Link to comment https://forums.phpfreaks.com/topic/226141-safari-and-chrome-not-displaying-imagesbackground-images-firefoxie-does/#findComment-1167670 Share on other sites More sharing options...
haku Posted January 31, 2011 Share Posted January 31, 2011 The first step to fixing cross-browser issues is to clean up the errors in your HTML. You have 16: http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fkithell.com%2Findex.php%23%2Fhome I have a feeling that cleaning these up will solve your problem, particularly as one of the major issues is that your link tag is all in caps (invalid in an XHTML doctype) and isn't self closed (also invalid in an XHTML doctype). Since the link tag is the one linking your CSS sheet, it's probably causing you troubles. Fix these issues and if the problem doesn't go away, let us know. Quote Link to comment https://forums.phpfreaks.com/topic/226141-safari-and-chrome-not-displaying-imagesbackground-images-firefoxie-does/#findComment-1167743 Share on other sites More sharing options...
raknjak Posted January 31, 2011 Share Posted January 31, 2011 nvm Quote Link to comment https://forums.phpfreaks.com/topic/226141-safari-and-chrome-not-displaying-imagesbackground-images-firefoxie-does/#findComment-1167789 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.