Sunday, June 16, 2013

When to use <b>, <strong>, <i> and <em>, and how to use them correctly

With the newest HTML 5 specification, there are lots of tags to format and mark portions of inline text to choose from. This sure causes some confusion, such as for the <bold> and <emphasis> tags. Which tag should you use, when should you use it and why? In the following lines, I will address the issue of <b> vs. <strong> vs. <i> vs. <em>.

Saturday, June 15, 2013

Log out from Google search, but stay logged in on YouTube at the same time

Do you want to stay logged out on Google search for privacy reasons, while staying logged in on other Google services such as YouTube, Blogger or Gmail? It seems to be impossible because when you log on to any Google account, Google will automatically log you on for all its services at the same time, and when you log out, you're logged out everywhere. You can overcome this with a little trick:

Tuesday, April 9, 2013

Static HTML vs JavaScript dynamic generation - which is faster?

Say you have a page containing a huge amount of data - a list of 1000 customers or products. Such a list may take a long time to render. I always wondered if it's actually faster to render the page using a clever JavaScript loop instead of one big chunk of static HTML. So I did a small benchmark to determine which method renders faster.

Monday, April 8, 2013

Run js-beautify, css-beautify and html-beautify from Notepad++

I discovered a way to integrate js-beautify with Notepad++. This way, you can beautify your HTML, CSS and JavaScript directly in Notepad++. There are other plugins for beautifying web code for Notepad++, but js-beautify is the best in my opinion. Since it has no plugin available for Notepad++, we'll have to kludge together our own solution.

Sunday, April 7, 2013

Very simple pure CSS collapsible list without JavaScript

Lately, I stumbled upon this great article on The CSS Ninja. It shows a technique for pure CSS collapsible lists, without any JavaScript. It works for all modern browsers. With Internet Explorer 8 or older though, it's not possible with pure CSS. These browsers need to emulate CSS pseudo-classes by adding a small JavaScript fix to the page, which I demonstrate at the bottom of this article.

Monday, April 1, 2013

How to install and run js-beautify, css-beautify and html-beautify on Windows

Lately, I learned about an excellent code beautifier for HTML, CSS and JavaScript called js-beautify. You can try an online version at jsbeautifier.org. The name js-beautify suggests that it can only beautify JavaScript, but the js-beautify package actually consists of three separate tools called js-beautify, css-beautify and html-beautify.