Tag Archives: CSS

Tip of the Day: Google Maps styling

Tip of the day: If you are trying to embed Google Maps in a website, and things look horribly wrong, make sure that the following css style rule exists for your map div:

#whateveryourmapdiviscalled img {
   max-width: none;
}

Google maps makes really interesting abuse of width for it’s layout. I’ve got img max-width at 98% for the rest of the site so that images scale down correctly in the responsive design, but for google maps, that just causes chaos.

Emacs Tip: Make CSS mode sane

The default CSS mode in emacs does very funny things with indentation if you like leaving the brace on the same line as the definition. As with everything in emacs, this is fixable with a few lines of config. In this case:

 ;;; Fixes totally weird default css formatting.
 (require 'css-mode)
 (setq cssm-indent-level 4)
 (setq cssm-newline-before-closing-bracket t)
 (setq cssm-indent-function #'cssm-c-style-indenter)
 (setq cssm-mirror-mode t)

I can’t remember where I found this on the internet, but here it is, repeated again, so more folks can find it.