Variable Visions

Articles HTML Minified


tutorials - HTML and Web-Development.

Minified

Published Tue. Mar. 26, 2013


Minified code can look daunting at first, and even frustrating if trying to decipher a block of code.

Minifying your code can make performance and speed increase.

 

There are online services for minifying code, but here is a way to do it with any text editor.

In this example, I used Dreamweaver, but any text editor with Find and Replace will work.

 

First, we select and copy a blank row and paste it into the Find field.

Then, simply replace it with emptiness, aka nothing.

This will get rid of the line breaks.

You then remove spaces buy selecting the biggest gaps first, and replace with nothing.

Do this again up to double spaces but DO NOT remove single spaces. You still need single spaces for, say, a href.

 

Your code is now minified. Take and look and remove any other breaks or spaces.

This worked great for me when I was working on a NetSuite Tag and there was a character limit on my include html.

I did not want to alter or remove content so I minified the code and re-uploaded. Remember, spaces count as characters, sometimes.

 

While minified code can be harder to read, it has its place.


Tag(s): Minified