jordumus Posted January 13, 2013 Share Posted January 13, 2013 (edited) Hello everone. The situation: I got images that I want to give a "max-width" attribute in CSS, so they don't mess up my screen. This works great in IE, Google Chrome and Safari, but seems to get messed up in Firefox and Opera (and old IE browsers) The code: The CSS: .tienjaar {max-width: 80%;display: block;margin-left: auto;margin-right: auto;} The html/php: <img class="tienjaar" src="some/img/url.png" alt="some alt text"/> The example: http://www.hondenvri...p?&loc=timelineI Test it in both Google Chrome and Firefox if possible, try to resize the screen, you'll see that the rightern box goes 'beyond' the screen. I am 100% sure that it is because of the images. Extra information: I am aware that I could just put a "width" instead of a "max-width", but that would mean stretching my images when they're smaller, which I prefer not to do. If you got any solution for this, thanks already!GreetingsJordumus Edited January 13, 2013 by jordumus Link to comment Share on other sites More sharing options...
dsonesuk Posted January 13, 2013 Share Posted January 13, 2013 It is also a margin applied to one of the image containers, also you may need to adjust min-width: on div#wrapper to stop right container going outside the outer edge of this wrapper container. Link to comment Share on other sites More sharing options...
jordumus Posted January 14, 2013 Author Share Posted January 14, 2013 It is also a margin applied to one of the image containers, also you may need to adjust min-width: on div#wrapper to stop right container going outside the outer edge of this wrapper container. Sorry, I don't quite get what you mean? Link to comment Share on other sites More sharing options...
dsonesuk Posted January 15, 2013 Share Posted January 15, 2013 It seems it will only work in these other browsers if a percentage is used with width:, but the drawback is, all images will be made to 80% of its parent container width. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now