When I graduated from college two years ago, I had back-end development in mind as a career path. When I started working at MediaSauce, I was suddenly thrust into the role of a front-end developer. I learned more about HTML5, CSS, jQuery, and IE testing than I really wanted to know. Over a year and a half and work on about two dozen websites has left me with some habits and ideas about front-end development.
If your users’ internet connections are probably going to be fast, you still do not have an excuse to be sloppy. I have heard the argument from other developers that because most people who use their sites have broadband internet, they do not have to worry about things like optimization. This pisses me off, frankly. What if they do not have broadband? There are still over 3 million people on dial-up internet connections.
If I were to use too many images in my site or it might increase the page load times and bog down the site. Now, we live in the first world in 2012 and most people on the internet have broadband and most modern browsers cache page assets like images. It is not much of an issue anymore. Still, I think it is good form.
For buttons that change appearance, use CSS3 or sprites. One of the most important HTLM4/CSS2 techniques that I learned for making buttons change appearance is the sprite. In a nutshell, a sprite is an image file that has all of the different appearances for a button or other element right up against each other and uses CSS to change which button state is shown.
For example, a button’s normal state would be showing as the element’s background-image
. When the user hovers their cursor over it, the element’s :hover
pseudo changes the background position instantly to show the “hover” state. The same goes with :active
or :visited
.
Why would you do things this way? It makes the switch between button states smoother. All of the button states are loaded at the same time because they are in the same image file. If the button states were all in different image files, then the new button state would have to be loaded every time, which would cause a lag. It’s a small thing that can make a big difference when it comes to the quality of your website.
I do not know if I have a specific point to make here. I suppose that if I did, it would be to seek out and adopt techniques that will make your website’s front end look nicer and be more useable.
I know people who have no interest in front-end development and, frankly, I do not blame them one bit. I am not that interested in doing front-end development. It is not the focus of my career, but I acknowledge how much more powerful a website can be when it loads quickly, looks nice, and works with users’ intuition.
Posted in Web
|
Tagged opinion, web
|
You must be logged in to post a comment.