Some Blogging Tips
[Last updated: 18th July 2005 8:00am PST.
Note: Thanks to everyone who has commented on this. It's clear from the comments that there
can never be one single answer, so I'll add the disclaimer that this post reflects what
I do. I strongly suggest reading all the comments to get several interesting variations
and a lot of background on various items].
We had the second Sun bloggers meeting in Menlo Park yesterday afternoon. About 20-25 people in the room and with about another 7-10 people on the phone. It was hosted by Linda with informal presentations/chats by Claire and Will. Dave was there to give the definitive answer on anything roller related. Jonathan stopped by for quite a while to chat and to answer (and ask) several questions. All very interesting.
At one point we discussed the large number of new bloggers that we got with the recent launch of Open Solaris. Blogging was new to some of them, so it wasn't as simple a task as perhaps it could have been. Liane asked if the more experienced bloggers could help out.
So here's my little bit. First of all, if you are a new Sun blogger, you should go to our internal blogging site ("blogs dot sfbay") and click on the "Blogs User Documentation" link near the top of the page. That will take you to the Sun bloggers Wiki. When you get there, click on the "FAQs" link in the "Find Your Answers" section. This should cover most of the common questions that you'll have when getting started.
Some people just want to write and don't want to have to learn HTML. I can understand that. It's hard to do a good job with something, when you are constantly fighting the tools. So if this resembles you, check out:
- Textism. It's web based. You type your text in the top area. There is a simple "markup" language to get to some of the HTML features and you then click the "Text to HTML" button to generate the equivalent HTML. You would then cut & paste that HTML into your roller blog entry.
- Markdown. It's written in Perl and you'd need to download and unpack it. It's similar in functionality to Textism, but several people who have tried both, prefer the simplicity and intuitiveness of Markdown.
Personally I think you need to know a little HTML to make your blog more interesting. I've tried several blogging clients and have always found that there is something that they can't do (or don't do the way I like) and have always reverted back to composing posts "by hand" in a text editor. I hear (from Geoff) that MarsEdit is good. The problem is that I create posts on Solaris (at work) and Windows Xp (at home) as well as Mac OS X (when travelling). I need something that's ubiquitous.
Here's the HTML I use. You really don't need all of this but I'll include it here anyhow. View this in conjunction with a simple HTML primer to get a better overall understanding of what HTML is and the tags described here. Like most languages, there are oodles of different operators and ways of doing things. To get going, you only really need to use a small subset of them.
I'll start with what I consider the essental tags:
- Paragraphs: The <p> tag.
- Line Break: The <br> tag.
- Links: The <a href="url">label</a> tag.
- Making Text Bold: The <b>...</b> tag.
- Underlining Text: The <u>...</u> tag.
- Emphasising Text: The <em>...</em> tag.
- Preformatted Text: The <pre>...</pre> tag.
- Including Code: The <code>...</code> tag.
- Unordered List: The <ul>...</ul> tag in conjunction with the <li>...</li> tag for each item.
- Quoting Text: The <blockquote>...</blockquote> tag.
Here are some other useful tags:
- Striking Through Text: The <del>...</del> tag.
- Headings: The <hn> ...</hn> tag.
- Making Text Italic: The <i>...</i> tag.
- Horizontal Rule: The <hr>...</hr> tag.
- Ordered (Numbered) List: The <ol>...</ol> tag in conjunction with the <li>...</li> tag for each item.
I like to include a small image near the top of most posts, and to do that I used to use:
<table>
<tr>
<td>
<a href="some link">
<img src="url for some image" /></a>
</td>
<td>
<p>
... first paragraph...
</td>
</tr>
</table>
After discussing this via comments to this post (see there for more details), I changed this to:
<div id="blogphoto">
<a href="some link">
<img src="url for some image" alt="" style="float: left" /></a>
<p>
... first paragraph...
</div>
<br clear=all>
and tried using this in my posts. I also had to add the following to my _css file:
#blogphoto img {
margin: 5px;
}
For a variety of reasons, I then reverted back to using tables.
If you don't care about the second or subsequent paragraphs wrapping up by the image or how close the text is to the side of that image, (or if you've successfully been able to deal with this directly in your _css file), then the image inclusion code is a lot simpler:
<a href="some link">
<img src="url for some image" alt="" style="float: left" /></a>
<p>
... first paragraph...
<p>
... second paragraph...
<p>
... and so on ...
There are lots more HTML tags, but those are really the only ones I use.
When I create a post, I use three web sites extensively:
- Google to research the article and find useful links. I also use Google Images to typically find the small image I include at the top of my entries. More often than not, I'll just use one of thumbnails that Google creates. I try to make sure that I don't use something that is copyrighted though.
- Amazon for all book related links.
- Dictionary.com to check on the spelling of words I'm not sure of. I don't normally spell-check an entry, just checkup on the words I think I might have misspelt. Dictionary.com is nice in that it'll give you a list of possible alternatives, so it's usually very simple to work out the correct spelling.
After I've cut & pasted my blog entry into the "Edit Weblog" roller window, I save it as a draft. Then I'll click on the "New Entry" link at the top to create a second window. I'll then select my new text under the "Recent Drafts" heading on the left side. In the other of those two windows I'll Preview that entry, and I'll review it to make sure it looks okay, make editing changes to the text to fix it up in the other window. One of my pet peeves with the current roller is their is no longer a way to preview the text for the post and to make changes in the same window. An earlier version of roller had this, but that feature has been removed (for some reason) from newer versions.
(Note: you should also validate what you've created, to avoid any possible syntax errors).
There's a lot more you can do with your blog (just check some of the examples at blogs.sun.com, but for people just starting out, knowing how to use the above tags should help you generate very nice posts.
I'm going to treat this as a "living" document for a while, so if you have any suggestions, corrections, additions or changes you think I should make, please let me know.
( Jul 01 2005, 08:47:17 AM PDT ) [Listen] Permalink Comments [13]
Comments are closed for this entry.












The "strike" and "u" tags have been deprecated since HTML 4.01 in 1999: http://www.w3.org/TR/html4/appendix/changes.html#h-A.3.1
One could argue that using "strong" instead of "b" would be preferable (markup vs. appearance) - the same goes for "em" and "i".
Have fun!
Posted by 80.165.184.114 on July 01, 2005 at 09:30 AM PDT #
Posted by Whatever... [Deepak Alur's Blog] on July 01, 2005 at 09:51 AM PDT #
Posted by Rune Hammersland on July 01, 2005 at 09:53 AM PDT #
Posted by Rich Burridge on July 01, 2005 at 10:11 AM PDT #
Posted by Thijs on July 01, 2005 at 02:16 PM PDT #
Using a floated image rather then a table, as Rune suggested gives three significant benefits.
Another reason not to use u - it makes things look like links.
Thijs brings up the subject of strong/b and em/i. This isn't an XHTML/HTML thing - in terms of what elements and attributes they have they are pretty much identical (aside from minor diffences like xml sticking an id attribute on everything). It is often confused as such thanks to (partly at least) Zeldman.
When people are introduced to authoring markup by the standards instead of tag soup, they are often introduced to XHTML at the same time - and the two concepts get tied together in their minds. Its as possible to write semantic HTML as it is to write semantic XHTML.
Strong and Em say that the data should have emphasis, and browsers usually render this using bold and italics. <strong>Usually</strong>. Take an aural browser (which outputs to a speaker and is rather useful if you are blind). B just says to make the font bold, if the data is being read out through a speaker, then it can't made bold, but it can be given emphasis.
Strong and Em aren't preferable over B and I as such. When you want to give something emphasis then you should use strong/em, when you want to make something bold or italic then b or i might be preferable (or just use CSS).
I'd also add validate validate validate - avoiding syntax errors is a good idea.
Posted by David Dorward on July 02, 2005 at 02:59 AM PDT #
For the last reason you give for not using tables - that's sometimes exactly the reason why I use a table. I just want to have one small paragraph beside the image rather than the next one wrapping up if there is room. Is there a way to prevent a second paragraph moving up beside the image, with the img wrap markup?
The reason why I haven't been using the alt tag is that the blog posts are usually just fine if there wasn't an image there, so there would be no reason to provide alternative text. Except...
Providing an indication for people with visual disabilities. Going back to b/i tag w.r.t. this situation for a moment. Typically what happens is the assistive technology that is outputing speech (screen reader, aural browser etc...) will use a different voice or voice inflection to indicate the text is bold or italic.
Posted by Rich Burridge on July 02, 2005 at 06:35 AM PDT #
Float says "Let content following this bubble up beside me." To go with it there is the clear property which says "I don't want to bubble up beside anything that is floating". So apply clear: left; to the first paragraph that you want below the image.
The alt attribute is required by the standard, if it is missing and the image is not displayed then browsers have to error correct. Often this is done by displaying the filename of the image. If the image is entirely presentational, then alt="" is perfectly OK. Alan Flavell has a good article on the subject. A good test of the quality of your alt text is to look at the webpage using Lynx.
Oh as an aside, while typing this in I've found a bug in your comment system. It fails to convert special characters to entities in the textarea when you preview - so it changed all my < to < - if I'd submitted again I'd have put paragraphs rather then less than characters in to the code example above. OK, looks like it won't let me post until I preview and not make edits. I've had to scrap the example entirely.
Posted by David Dorward on July 02, 2005 at 06:57 AM PDT #
Thanks (again) David! You've convinced me (on image wrap vs table). I'll try to wrap my brain around doing it for my future posts, and try not to include any blockquote sections in that first paragraph so they don't get screwed up.
I'll also start putting alt="" in all my redundant image inclusions.
And finally, I'll let Mr Roller (Dave Johnson) know about the comment system bug.
Posted by Rich Burridge on July 02, 2005 at 09:46 AM PDT #
Sorry Dave. Two more questions.
I've just gone back and adjusted the HTML for this post, to use the image wrapping tags rather than the table. I've also tried to put in a
tag that clears, so that it moved down to below the image.
That moving down is not happening, and the text being wrapped around the image is way too close to the image. What am I doing wrong for the first problem, and how do I fix the second one?
Note that I haven't tried to do this in my CSS, but rather directly in the HTML, if that makes a difference.
Posted by Rich Burridge on July 02, 2005 at 10:04 AM PDT #
Okay, I've solved the imaging margin problem by adding:
img { margin: 10px; }in my CSS file. Still investigating the correct way of clearing the paragraph to move it down.
You know, when I do have the answer, I can see my anal-retentive side showing, and making me go back and fixup all the previous table entries.
Posted by Rich Burridge on July 02, 2005 at 06:09 PM PDT #
And I now have a solution to the other problem. I had to use:
<br clear=all>
rather than:
<p clear=all>
which now gets the desired effect. Cool. I'll use this in future.
Posted by Rich Burridge on July 02, 2005 at 06:18 PM PDT #
Last comment on this particular subject. I found that setting "margin: 5px;" for the img tag in my CSS file was affecting the spacing of all images (duh!). This forced all the "Now Reading" books on the right side into one column.
So instead I now have:
#blogphoto img { margin: 5px; }in my CSS, and the image at the top of my blog post looks like:Posted by Rich Burridge on July 02, 2005 at 09:07 PM PDT #