CSS & HTML Tips

HTML: Make a Page Refresh Every xx Seconds

A quick tip for those who just started learning HTML. It’s possible to add a line of code in your HTML page so that it’s automatically refreshed every few seconds when loaded in the user’s browser. To make the page automatically refresh itself every 60 seconds, just insert the following code in the <head></head> section …

HTML: Make a Page Refresh Every xx Seconds Read More »

The Ultimate Way to Cloak and Hide any Website Address or URL (Stealth Forwarding)

Most of the existing URL cloaking services are only a redirection by a randomly generated short URL. The real URL of the target website or web page will eventually be revealed when the visitor arrives at it after the obscure redirection. So how to ACTUALLY hide and cloak the destination URL of any website or …

The Ultimate Way to Cloak and Hide any Website Address or URL (Stealth Forwarding) Read More »

CSS: How to write CSS rules to detect or target Chrome, Safari or Opera browsers only?

It’s easy to target firefox, just write as expected by the standards, at least most of the time. It’s also easy to target IE and any specific versions of them by a few of the famous hacks or the IE conditional comments to selectively include style sheets by version numbers. But how does one write …

CSS: How to write CSS rules to detect or target Chrome, Safari or Opera browsers only? Read More »

Use Relative Protocol URL Address to Automatically Determine Web Address Protocol (HTTP or HTTPS)

Here’s a really interesting bit about how you can omit the protocol part of a web address in your web pages. The predominant belief is that an HTTP:// or an HTTPS:// has got to be prefixed to a URL or it won’t work, truth is, it will. Try the following link: Click Me! View the …

Use Relative Protocol URL Address to Automatically Determine Web Address Protocol (HTTP or HTTPS) Read More »

HTML: Make Content Editable in Element / Tags without JavaScript

It’s not well known but this feature was invented by Microsoft and has been implemented across all major modern browsers ever since IE 5.5. Adding an attribute of contenteditable and assign a value of “true” to it makes the content value / inner text of that element editable by a single click: <blockquote contenteditable="true">Click to …

HTML: Make Content Editable in Element / Tags without JavaScript Read More »

You can actually use percentage values for padding and margin

Which seems quite new to me as I have never used any percentage values on them before. Took some tests and I found out that all major modern browsers supported percentage values for padding and margin very well, even IE6. This should come very handy in positioning things up according to the parent width. See …

You can actually use percentage values for padding and margin Read More »

How to prevent or stop my website and pages from being indexed by search engines?

It’s really weird that one would like to do this but perhaps you are running some private website dedicated to just an intimate group. Anyway, you can stop search engines indexing your web pages by putting a meta tag in the header section of them: <meta name="robots" content="noindex" /> That’s it. Any search engines abiding …

How to prevent or stop my website and pages from being indexed by search engines? Read More »

How to redirect the visitor to another page or website?

This is one of the most common tasks in website development and also one of the most frequently asked question according to some of the keyword research tools. Well, you have 3 ways to achieve a web page redirection. Use PHP header() function to modify and send a HTTP Location header: header("Location: /thankyou.html"); // redirect …

How to redirect the visitor to another page or website? Read More »

CSS: How to align HTML input checkbox and radio with text on the same line?

The common HTML form input controls of checkbox (<input type=”checkbox“>) and radio (<input type=”radio“>) can be tricky to be aligned correctly in the same line with the text or image across all modern browsers. Without any CSS styling, they usually place themselves 3 or more pixels above or below the normal text flow which look …

CSS: How to align HTML input checkbox and radio with text on the same line? Read More »

Please, by all means, don’t use overflow:hidden for content!

No matter how fairy or pretty your design / template is, never use overflow:hidden for content containers. Content comes a thousand times more important than any design or layout. I don’t care how much you hold proud your artistic work and how you think accommodating the content in any way possible would ruin the holy …

Please, by all means, don’t use overflow:hidden for content! Read More »

CSS: Set width on inline elements with inline-block

With display:block elements we can freely set the hard width of them. However for inline elements, width:200px simply won’t work at all. One approach is to float the element which usually causes other problems and isn’t handy at all. So how to set width to inline elements without floating them in CSS? The answer is …

CSS: Set width on inline elements with inline-block Read More »

CSS: Curved or Rounded Corner Boxes and Images Using border-radius

In CSS3, border-radius is the rule you would use to achieve curved corner borderlines, but for now, IE and Opera doesn’t support this trick. With a little script help in the form of a .htc, you can make a cross browser compatible rounded corner box such as a <div> or an <img>. -moz-border-radius: 9px; -webkit-border-radius: …

CSS: Curved or Rounded Corner Boxes and Images Using border-radius Read More »

How to make IE6 to style HTML 5 tags?

HTML 5 comes with a bunch of new tags that IE6 cries that it doesn’t know them, thus refusing to style them according to the CSS. To baby-sit this stupid browser one last time, adding these JavaScript lines in the <head> of your web page that utilizes HTML 5 tags: <script> document.createElement(‘header’); document.createElement(‘nav’); document.createElement(‘section’); document.createElement(‘article’); …

How to make IE6 to style HTML 5 tags? Read More »

Scroll to Top