CSS, or cascading style sheets is a language used in front-end web development. It is commonly used in conjunction with HTML and/or Javascript. CSS can be considered the "styling" document used in your development. It is used to define the styling of elements, colors, shapes, sizes and even interactive elements such as image rollovers. This is much different than previous years, before CSS took hold. Entire websites were built using strictly HTML. This became very cumbersome. The same website that can be built today using a few lines of code would have taken hundreds of lines of code back then. Lets dive into some benefits.
There are many benefits to using CSS in your development and it doesn't always have to be about styling.
Global changes can easily be accomplished. Lets say you wanted to change the colors of links throughout your website. You can simply change the color within the style sheet and all links throughout the entire website will change accordingly. Previous to CSS, you would have to go to each webpage and change the color.
File size is also important in web development, today. As time becomes more precious and user patience becomes shorter and shorter, you need to be aware of your load times of websites. By using a style sheet, you are reducing the actually file size of your HTML document, therefore reducing the amount of time it takes a page to load. You can also use tools to reduce that time even more; tools that clean up your code such as CSSTidy.
Search engine optimization (SEO) is affected by your use of style sheets. Search engines scan the source code of pages to determine its content. If we took a website from 10 years ago, the search engine would have to rummage through hundreds of lines of code before it could even find valuable content. By using a style sheet you are increasing the amount of "scannable" content vs the amount of code.
Consistency plays a big part in user-experience in the online environment. By using a style sheet, you are creating consistency by styling all of the elements within your pages the same. For instance, your font sizes won't change page to page, your links won't change and nor should your header tags and other elements. When each page used to be adjusted manually, you would find inconsistencies among pages. That's not great for branding.
Having to deal with multiple browsers wasn't too much of a concern years ago. However today, developers have to make sure that a website "works" on all primary browsers. When using style sheets, the developer has the ability to adjust code for certain browsers if there are inconsistencies among the browsers.
So, what did you learn today? You learned that cascading style sheets, or CSS, have advanced web development in many more ways than one. And, you've learned some of the benefits to using style sheets in your development.
Post a Comment