Styles in Google Docs!

-- Jean-Luc Godard, French filmmaker and author
OVERVIEW
Templates, Styles and Better Formatting have been among the most requested Google Docs features. Well, you asked and we listened!
So, as a first step we've enabled "Edit CSS" on Docs such that you can explore styling documents. Think of Docs as the platform and the world wide web your place to explore the different styles! The possibilities are endless!
Secondly, we've included some examples of CSS styles here to get you started. It's important to note that CSS is something that takes advanced knowledge and we don't recommend utilizing this functionality unless you're comfortable and familiar with it.
As we all know, this is a user help group, so please utilize this pages section to help one another out and to engage in CSS information sharing. We recommend you use outside sources to enhance your knowledge of CSS styles. A simple search for "CSS Examples" or "CSS Tutorials" is a good place to start.
The examples given below just scratch the surface of the style possibilities so I'm very excited to see the different styles you all create.
Current Limitations
- "Edit CSS" is not supported offline (with Gears) yet.
- Images (specified through styles) are not propagated through Export as PDF/Print yet.
- In this initial launch of CSS, we won't be allowing external image URLs to be used with CSS in Docs. However, you can still utilize images by uploading them and using the Docs image URL instead. There are instructions about this in the first example below.
Getting to your CSS dialog box!
EXAMPLES
Screenshots of actual Google documents styled with CSS. Yes, you can do this too!Adding an image
Need to add an image to your document? Follow these easy steps:
- Upload the image by going to the Insert > Picture option in the menu. You can upload images from your computer or from elsewhere on the web.
- After the image has been uploaded, go to the Edit > Edit HTML option in the menu, and find the image tag. It should look something like this:
<img id="abc123" style="width: 100px; height: 100px;" src="File?id=abcdefg123456_987654zyxwv"> - Copy the image src (shown above in red), and paste into your CSS. For example, if you wanted to use the image as a background for the document, you would use:
body {
background-image: url('File?id=abcdefg123456_987654zyxwv');
}
Once an image has been uploaded, it can be used in any of your documents, so you may find it easier to create a separate document with all your images for easy reference.
Adding a watermark (non-repeating background)
CSS
background-image: url('File?id=ad8wdwbvms_890m8v5pjdm_b');
background-repeat: no-repeat;
background-position: 50% 20px;
}
Note: background-position is used to center this watermark at the top of the document. You could omit this and the watermark would appear in the top left of your document, or change it to move the watermark to a specific place in the background.
For more information, check out the help document here!
Repeating backgrounds
CSS
body {
background-image: url('File?id=ad8wdwbvms_884g9vm4zwk_b');
background-repeat: repeat-y;
padding-left: 70px;
}
p {
line-height: 20px;
}
Note: Since the blue lines in this image are 20 pixels apart, a line-height of 20px is used to ensure the text and horizontal lines remain evenly spaced. Also, padding-left is used to prevent the text from straying into the left margin of the notebook paper image.
Want to learn more about this notebook image. Take a look at the doc here!
Styled Headers
Do you like your header to have some personality? Look no further. The information below will give you the ability to change your borders and text to different colors, sizes, widths and so on. You need only do the following:- Write some text and choose Heading (H1), Sub-Heading (H2) or Minor Heading (H3) in the "Format" drop-down menu
- Add your H1, H2 and H3 styles to the "Edit CSS" dialog
CSS
background: url('File?id=ad8wdwbvms_902f9z2wgd8_b') no-repeat top left;
padding-top: 26px;
padding-left: 80px;
text-transform: uppercase;
font-family: Garamond;
font-size: 22pt;
color: #003300;
border-bottom: 3px double #003300;
}
h2 {
background: url('File?id=ad8wdwbvms_905cwjztrfc_b') no-repeat top left;
padding-top: 12px;
padding-left: 32px;
font-family: Garamond;
font-size: 18pt;
color: #003300;
border-bottom: 2px solid #003300;
}
h3 {
background: url('File?id=ad8wdwbvms_906cb8g4mgj_b') no-repeat top left;
padding-top: 0px;
padding-left: 32px;
font-family: Garamond;
font-size: 14pt;
color: #003300;
border-bottom: 1px solid #003300;
}
Styled Quotes
Make your quotations really speak out by styling your blockquotes.CSS
border: 3px double #AAAAAA;
font-family: Garamond;
padding: 15px 15px 15px 100px;
margin: 0 80px;
background-image: url('File?id=ad8wdwbvms_887fk6jk2hh_b');
background-repeat: no-repeat;
}
Learn more about styled quotes here!
Image Borders
We know you all want your lovely logos enveloped with a border. It's easy! Just insert an image into your doc and put the text below in the "Edit CSS" dialog. CSS
border-width: 2px;
border-style: dashed;
border-color: #999999;
}
Add some spice to your lists by styling your bullets as images.
CSS
ul li {
list-style-image: url('File?id=ad8wdwbvms_872c3mz8xdt_b');
}
/* leaves */
ul li {
list-style-image: url('File?id=ad8wdwbvms_873dqzfb4fj_b');
}
/* stars */
ul li {
list-style-image: url('File?id=ad8wdwbvms_874hn5b66fm_b');
}
Note: We're using ul li here. This ensures that any numbered lists (ol) in your document retain their numbers.
Styled Resume Doc






David Millar
Invite as author
Wishlist: Allow Browser-Specific CSS
-moz-border-radius:0
-webkit-border-radiu
border-radius:0.5em;
I get this when I save the CSS:
/* -moz-border-radius: 1em; */
/* -webkit-border-radiu
border-radius: 1em;
It would be nice if my document could use those features where supported.
EditSaveCancelDeleteDeleteBlock this userReport abusive commentHide report window
Eric Celeste
Invite as author
Wishlist: Self-defined Styles
mycoolstyle {
color: green;
}
...in the CSS and then have Gdocs add "mycoolstyle" to the "Styles" menu for me to select.
I would also like the styles to apply to spans of characters, not just to whole paragraphs.
This is _so_ close to the "CSS" word processor dream I've wanted for a long while. Keep going in this direction, I think it is rich with potential.
mycoolstyle {
color: green;
}
...in the CSS and then have Gdocs add "mycoolstyle" to the "Styles" menu for me to select.>>
Me too.
EditSaveCancelDeleteDeleteBlock this userReport abusive commentHide report window
They can. Classes DO work, so to do so, define a class and go to Edit> Edit HTML and apply the classes EXAMPLE (I do realize it's very impractical, but it gets the point across):
CSS:
.r {
color: red;
}
HTML:
<span class="r">Tex</span>
NOTE: The 't' will not be red
EditSaveCancelDeleteDeleteBlock this userReport abusive commentHide report window
Emmanuel Eytan
Invite as author
Numbered headings
http://www.w3.org/TR
But it didn't work. Dang! Numbered headings would be nice.
http://knol.google.c
I saw it in the "Christine The Guide also wrote" box at the top right of this page... but it isn't listed there now?!! Oh, I see, there's an expansion link, and it IS in the expanded list. The "also wrote" list must be dynamic.
EditSaveCancelDeleteDeleteBlock this userReport abusive commentHide report window
EditSaveCancelDeleteDeleteBlock this userReport abusive commentHide report window
EditSaveCancelDeleteDeleteBlock this userReport abusive commentHide report window
Ali
Invite as author
CSS for Forms
That is: While editing your GDoc,
1. Click Edit
2. At the bottom of the dropdown menu, click Edit CSS.
BUT don't put <style>...</style> around your CSS. I had to find that out by trial and error and finally going for HELP and reading this page and the examples above. What you type in the Edit CSS dialogue box will evidently be the content of your inline style sheet. It can't have the HTML "style" tag surround, or it won't even be saved.
EditSaveCancelDeleteDeleteBlock this userReport abusive commentHide report window
EditSaveCancelDeleteDeleteBlock this userReport abusive commentHide report window
EditSaveCancelDeleteDeleteBlock this userReport abusive commentHide report window
EditSaveCancelDeleteDeleteBlock this userReport abusive commentHide report window
vim
Invite as author
program overrides
EditSaveCancelDeleteDeleteBlock this userReport abusive commentHide report window
li {
list-style-type: lower-alpha;
}
EditSaveCancelDeleteDeleteBlock this userReport abusive commentHide report window
Casey T
Invite as author
Printing CSS Styled Docs
Anonymous
Invite as author
External style sheets?
Is Google Docs able to produce downloaded Word/PDF/etc.version
EditSaveCancelDeleteDeleteBlock this userReport abusive commentHide report window
EditSaveCancelDeleteDeleteBlock this userReport abusive commentHide report window
Josué Santos
Invite as author
Helpful!
David Megginson
Invite as author
Default CSS for new docs
EditSaveCancelDeleteDeleteBlock this userReport abusive commentHide report window
Anonymous
Invite as author
How do I change a link color in a Google Doc using CSS?
Right now the default link color is blue and that becomes a problem if I change background to a dark color and elect to use white text, even for the link.
Thanks for responding.
a { color:green; }
Visited links are often shown as a different color in a browser (to help remind you of where you've already been). To color these, you would use:
a:visited { color:orange; }
You can define both regular and visited links at the same time with:
a, a:visited { color:brown; }
EditSaveCancelDeleteDeleteBlock this userReport abusive commentHide report window