New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print media query for img max-width breaks Google Maps printing in Chrome #1741
Comments
X-Ref: twbs/bootstrap#1506 |
Is that bug really related? This is specifically related to the print styles, not the regular img display. |
Same underlying issue, which is that |
@rdlugosz It was introduced in order to prevent images from getting cut off on print. |
That's reasonable, but while it fixes a problem with images being cut off, Any thoughts on how this could be adapted to solve the basic image problem Or, would this be better resolved via a readme or FAQ item? On Thursday, January 14, 2016, Cătălin Mariș notifications@github.com
|
Just read the solution in the link @cvrebert posted. img[src^="http://maps.gstatic.com/"], /* map view */
img[src^="http://maps.googleapis.com/"] /* street view */
{
max-width: none !important;
} |
s/the solution/a mediocre solution/ |
…nd other widgets print correctly See h5bp/html5-boilerplate#1741 X-Ref: #1506
If it's good enough for bootstrap, then why not. :) Open to a PR like twbs/bootstrap#19000 |
Following the lead of Twitter Bootstrap (see: twbs/bootstrap#19000), remove the print media query that sets a max-width of 100% to images. This code was meant to prevent images from being cut off in print, but has a side effect of causing map tiles to disappear when printing medium-to-large maps (e.g., with Google Maps). For reference, this style was added to H5BP in h5bp@b2faa1f
Following the lead of Twitter Bootstrap (see: twbs/bootstrap#19000), remove the print media query that sets a max-width of 100% to images. This code was meant to prevent images from being cut off in print, but has a side effect of causing map tiles to disappear when printing medium-to-large maps (e.g., with Google Maps). For reference, this style was added to H5BP in b2faa1f
Somewhat related to the issue with images in IE8 (#984), after a long search I've discovered that line 260 in the H5BP print media query breaks printing of Google Maps if your browser is too wide (or, more specifically, if the map div is wider than ~800px). I've seen this on several WebKit browsers; example below tested on Chrome 46.
The map will look fine on screen, but when you hit print you'll notice that all of the tiles are missing. I've created a demonstration here . Note that the only file changed in this repo from the default H5BP install is index.html.
The simple fix is to override the style via:
... but this took me a rather long time to discover (on and off for weeks until finally digging in with process of elimination). Is there a reason why this style is being set?
It strikes me that this could be considered a Google Maps bug and not that of H5BP, but thought this would be a better place to start. After all, a stock browser does not exhibit this problem until H5BP is introduced.
The text was updated successfully, but these errors were encountered: