Demo – 15 Useful Code Snippets for Smartphone Website

3. Increase Clickable Area

4. Change CSS by Screen Width

Change browser size if you are using PC or Mac. If you are using your smartphone, rotate it. It displays pink background colour in portrait orientation, blue in landscape orientation.

5. Make Div Clickable If There Is Link Text

“Everything that can be imagined can become reality.”

Physicist – Willie Gallon

6. Flexible Images

Default

Flexible Images

7. Display High Resolution Images for Background

300px x 150px

600px x 300px

9. Hide Address Bar

Automatically hide address bar after page is loaded using JavaScript. Please reload this page if you missed it.

11. Change Highlight Colour

Default highlight colour
Custom highlight colour

12. Numerical Inputs for Forms

– type=”number”

– type=”tel”

– type=”text” pattern=”[0-9]*