January 22, 2004
8:03 PM   RSS feed for this thread Subscribe

Can anyone recommend a good HTML code beautifier? I have Dreamweaver MX, but as near as I can tell, it won't do this. I'm specifically looking for something to do good logical indenting, take care of whitespace, etc.
posted by oissubke to (11 comments total)
htmltrim for Windows, htmltidy for everything else.
posted by majick at 8:07 PM on January 22, 2004


dreamweaver doesn't have htmltidy built in? Install homesite+ from the MX CD, that will treat you better.
posted by Hackworth at 8:27 PM on January 22, 2004


Sorry, I'm an idiot. They have something like unto it, but they call it "Apply Source Formatting." Found it the hard way.
posted by oissubke at 8:33 PM on January 22, 2004


But "apply source formatting" doesn't do indents, does it?
posted by signal at 9:11 PM on January 22, 2004


It seemed to do the trick. The code looks more or less just the way I was hoping it would.
posted by oissubke at 9:15 PM on January 22, 2004


Not strictly on topic, but Top Style is good for cleaning up .css files. It alphabetizes them, which was a pet peeve of mine, among many other things.
posted by signal at 9:19 PM on January 22, 2004


It alphabetizes them, which was a pet peeve of mine, among many other things.

That seems like an incredibly bad thing. There was a discussion of this on the css-d list a while back if you want more info, but remember the Cascading part of CSS. Alphabetizing rules means they will be applied in aplhpabetical order, which isn't going to work for anything beyond the simplest CSS.
posted by yerfatma at 5:18 AM on January 23, 2004


I agree with yerfatma. I tend to start with body and work my way down through the HTML tags, then ids and finally classes. I think having #menu between h4 and p would less than intuitive.
posted by cedar at 5:44 AM on January 23, 2004


Aracnophilia (free/careware) does that for me
posted by magullo at 6:02 AM on January 23, 2004


yerfatama: Apparently I use "the simplest CSS", since it works for me. As I understand it, the cascading aspect has more to do with the browser object model (and what's inside what in the actual HTML) than with the order of the css definitions, but of course I could be wrong.

cedar: Top Style has an option to group by tags, ids, classes, etc. first, then alphabetically.
posted by signal at 6:08 AM on January 23, 2004


HTML Tidy is a great tool. Works on many platforms and is very configurable.

On preview, what majick says, except I like Tidy on Windows too.
posted by Icky at 10:08 AM on January 23, 2004


« Older I've been given a free upright...   |   Who is owed the United States'... Newer »

You are not logged in, either login or create an account to post comments



Related Questions
How can I strip out extraneous CSS rules from my... July 28, 2007
Mark CF, if you're reading this, shoo! January 23, 2007
Splitting Code Between Multiple SSI February 6, 2006
HTML for Web page counter? May 10, 2005
I have to use Frontpage to run an intranet - so... March 10, 2004