Tips on input text field initial value

Author: Rockia  |  Category: Web Design

The theories and practical skills nowadays in web designing is quite different from what I started with 10 years ago. Today I am going to talk about sometime that’s surprisingly not being changed much. Let’s look at a picture below:

Familiar, right? Yes, we can still see a lot of this style login form around this infinite triple-w world. I won’t say it’s a bad thing, but since the space on your page is very limited and valuable (unless you don’t have contents to put on. :D ). How about we want to save some space? However we can’t just delete the “username” and “password” label in front or else you will lose your users the other day when you wake up.

So what’s the alternate option? Well, let’s play some CSS and basic mouse action.

We can see an example before we get started. Let’s look at Apple’s MobileMe website.

It’s a good idea that show the users what those text fields are using the text fields themselves. The following code here are showing that if there is nothing input by the user in the text field, it will have a gray initial value, that’s, “Gray Text” in my example. Once the user click in the text field and ready to type in their own value, the “Gray Text” will disappear and replaced by what the user type in. However, if the user suddenly decide to move out before the type in anything and click somewhere else on the website, the text field will be given back the value “Gray Text”.

<html>
<head>
<style type=”text/css”>
.gray_font {color:#666;}
.black_font {color:#000;}
</style>
</head>
<body>
<input type=”text” class=”gray_font” value=”Gray Text” onclick=”if(this.value==’Gray Text’){this.value=”;this.className=’black_font’}” onblur=”if(this.value==”){this.value=’Gray Text’;this.className=’gray_font’}” />
</body>
</html>

What do you think? This is just an simple example. Use your creativity, you can probably use an image as your background.

Reduce HTTP request

Author: Rockia  |  Category: Web Design

I made a review on my coding style today and I found that I made a big mistake.

I always made a folder called “JS” and “CSS” when I first start scatching a website from blank. And I will put all different .js and .css files insides. For example, if I have 3 pages called “aboutus.php”, “main.php” and “jobs.php” in my website, I will put at least 3 different CSS files into the CSS folder; well, they will be mostly called “aboutus.css”, “main.css” and “jobs.css”. For certain of time, I found this very useful, like when I need to change the style of some elemetns under “main.css”, I can just look under the “main.css” and I don’t have to scroll the whole “css.css”.And ALL of these are stored in the files call “top.php” that will be contained in each pages.

However, I found this is a big problem today. IT INCREASE THE TIMES OF HTTP REQUEST!!!

OK, I guess no one will have the “style” in each different elements nowadays when we are going to write out the whole site. Most people, I will say 99.99%, will have the .css files as external links outside of the page. And example will be:

<link rel="stylesheet" href="css/index.css" media="screen"/>

Actually, when the browser loads this website, and it “sees” this line, it will make a request to the server for this “css/index.css” file. Here the first time. Like I said, if I have 3 different files, the browser will actually make 3 request to the server. This might not sound too bad. However, if I have another 3 .js files there. Then for each page, it will at lease send 6 requests to the server for all these external files before the page <body> tag was load; yes, that means, before you see anything on your screen, the server has 7+ requests already. Plus, there will be some more requests for the images and all different other medias (I will talk about those later on.)

Let’s say, if you only have 1 picture and 2 divs in your page, then your browser will make at lease 10 requests, and 6 of them were made before your page was displayed. And I have 3 pages, if the person is interested in my site and he/she wants to read all of these, then there will be 18 requests before pages’ content was loaded.

If we merge all these .css files into one, and all the .js files into one .js. We can save 2/3 of the requests in this case before the page content is loaded.

Thinking from “Domain for sell”

Author: Rockia  |  Category: Web Story

The flame of 2008 Beijing Olympics was lighten up this morning. Yet when I browsed eBay, I found something very interesting. This eSeller bought the domain of 2012 London Olympics and put it on eBay for sale.

All I can say is, “WoW, the price is so high.” However, it gave me an idea that web design is not just about technology. Most of the time, creativity is from the things around us.

Even though this is just for the domain, but hey, who knows. Maybe someone will design an Olympics website for London and then sell it to England for better price than the domain?

Reference Link from eBay:

Olympics Domain for sell

Web 2.0 Tool Kit

Author: Rockia  |  Category: Web Design

http://www.dezinerfolio.com/2007/04/22/the-web-designers-tool-kit/

Check this out, a great page that has lots of useful sites on it.