October 23, 201214 yr Hi all, I was wondering how I would go about styling text that is contained within a <script> tag inside the <head> tag (if you know what I mean) I'm trying to add Google Maps API V3 to a site, but am testing it in a plain HTML file first. I have it styled pretty much the way I need it, but the styling I have is: html { height: 100% } body { height: 100%; margin: 0; padding: 0; font-family: Arial, sans-serif; font-size: 14px; } #map_canvas { height: 100% } h1 { font-size: 18px; margin: 0 0 5px 0; padding: 0; } img { float: right; } which is all in the HTML file. This is what I am trying to style when I add this coding to my site: var infowindow = new google.maps.InfoWindow({ content: '<h1>Kilians Lodge</h1><img src="image.jpg"> Main St,<br /> Mullagh,<br /> Co. Cavan, <br />046 924 2201 <br /><a href="http://www.kilianslodge.com">www.kilianslodge.com</a>', map: map }); So I can't throw the current CSS into the site or it will change the body of the site. Any advice on this, thanks. Al.
October 23, 201214 yr Have you tried adding class or id attributes to the html within the script? That way, you can style the tags by using class or id selectors in your css? It's currently 7am and I haven't slept yet, so sorry if I'm missing something. Edited October 23, 201214 yr by Pete Prosper
October 23, 201214 yr Just wrap that HTML bit in a div tag, give the div a class, and apply styles to it's children. .class h1, .class p etc.
October 23, 201214 yr Author Great thanks guys, I just wasn't too sure about how to figure that one out, but now that you say it it seems very simple and I should have known. Thanks
Create an account or sign in to comment