CSS & HTML Tips

CSS: Double Border

In pure CSS solutions, a double border can be achieved via either a combination of single borders or a single double border style. 2 single borders The HTML: <div class="wrap-1"> <div class="wrap-2"> </div> </div> The CSS: .wrap-1 { border:1px solid blue; padding:1px; /* how far away 2 borders are drawn, remove this line to make …

CSS: Double Border Read More »

CSS: Difference between opacity:0, visibility:hidden and display:none

If you are going to make part of the page totally transparent, there are essentially 3 CSS ways to achieve element transparency: opacity:0 (needs 2 more hacks for different browsers) visibility:hidden display:none Bob, the man! Let me take the example of Bob sitting in a chair to explain how these styles are different from each …

CSS: Difference between opacity:0, visibility:hidden and display:none Read More »

CSS: Styling File Upload / Select Input Control <input type="file" … />

Let’s face it, the native implementations of file uploading control of HTML form is ugly, throughout most of the browsers, and not consistent at all. Plus, <input type=”file” … /> just doesn’t play by quite a few of the CSS input styling rules such as border and background, making it a even bigger challenge. Now …

CSS: Styling File Upload / Select Input Control <input type="file" … /> Read More »

PHP: Checkbox Array in Form Handling – Multiple Checkbox Values in an Array

Checkboxes is probably one of the most frequently used form controls which come handy in dealing with one to many relationships. The multiple selective nature of HTML form checkboxes require a convenient way for PHP to process multiple checkbox values, ideally in a single array. By default, each and every HTML input control including checkboxes …

PHP: Checkbox Array in Form Handling – Multiple Checkbox Values in an Array Read More »

HTML CSS Drop Down Menu Made Easy – SuckerFish Enhanced

There’s a pure css drop down menu named SuckerFish published at ALA. Really straightforwardly clean code and simple drop menu script, however it might be friendlier for developers if it’s combined with the li:hover hack for IE6. The HTML: <ul id=”nav”> <li><a href=”#”>bodycare</a> <ul> <li><a href=”#”>lotions</a></li> <li><a href=”#”>creams</a></li> <li><a href=”#”>balms</a></li> <li><a href=”#”>butters</a></li> </ul> </li> <li><a …

HTML CSS Drop Down Menu Made Easy – SuckerFish Enhanced Read More »

Extended CSS Sprites for Foreground Images <img>

CSS Sprites is a popular way to reduce image requests to the server and hovering lag to load another background image cased by network latency. Jenny has also devised a technique for foreground image CSS sprinting by Extending CSS Sprites which in essence bears all the merits of the original CSS Sprites method. Basic concept …

Extended CSS Sprites for Foreground Images <img> Read More »

HTML DocType Text: World’s Tiniest and Shortest HTML DocType Declaration

Dustin Diaz made an interesting discovery to trigger “standards mode” with just a tiny little declaration instead of the regular lengthy one we see everywhere. As opposed to “standard mode“, there’s this “quirks mode” in IE that accommodates legacy HTML code of no standards at all — rendering them in many different ways compared with …

HTML DocType Text: World’s Tiniest and Shortest HTML DocType Declaration Read More »

Elements with display:block and height gains 100% width and don’t float in IE6

As we all know that with a style rule of width or height, an element gains hasLayout in Internet Explorer and it triggers the IE proprietary rendering algorithm. Though this trick solves many weird problems in IE, especially IE6, it does come with a few issues as well. For example, when you need a top …

Elements with display:block and height gains 100% width and don’t float in IE6 Read More »

What are the Mandarin Chinese web safe fonts?

As I’m a mainlander Chinese, I can only speak for those computers and browsers who live in central P.R.China. If you are making a design for or in Mandarin Chinese, especially Simplified Chinese, beside those common English web safe fonts such as Arial and Verdana shipped in MS Windows by default that 95% mainlander Chinese …

What are the Mandarin Chinese web safe fonts? Read More »

Scroll to Top