开发者

Google maps V3 API - css reset causes scrollbars

This is in my reset script:

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldse开发者_运维知识库t, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
 margin: 0;
 padding: 0;
 border: 0;
 outline: 0;
 font-weight: inherit;
 font-style: inherit;
 font-size: 100%;
 font-family: inherit;
 vertical-align: baseline;
}

My google code sizes the infowindow to fit the content unless I have this code in my CSS. By trial and error I found that if I remove margin:0 then the scrollbars disappear and the content fits correctly, and the infowindow is resized as expected.

I also found that if I removed the "p," from the list of tags it works as well - so I am assuming I can't have the margin set to 0 in my reset script.

I have no idea how to resolve this. It makes no sense!

This code actually works and the google maps infowindow is fine:

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
 margin: 0;
 padding: 0;
 border: 0;
 outline: 0;
 font-weight: inherit;
 font-style: inherit;
 font-size: 100%;
 font-family: inherit;
 vertical-align: baseline;
}
p{
 padding: 0;
 border: 0;
 outline: 0;
 font-weight: inherit;
 font-style: inherit;
 font-size: 100%;
 font-family: inherit;
 vertical-align: baseline;
}


How are you including the Google Maps in your web page? Is it a popup window? An iframe? Or is it embedded directly into one of pages, like contactus.html? Without knowing how the HTML works its hard to pinpoint errors. Additionally, does this only happen in IE, or does it happen in multiple browsers? Knowing the scope helps determine if its a browser issue or a coding issue.

If it is possible, my solution would be to use a different stylesheet for the web page with Google Maps. That way you don't have to deal with whatever the issue is in the reset.css file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜