- Learning Less.js
- Alex Libby
- 392字
- 2021-09-03 09:38:04
The role of HTML and CSS
If you spend time developing websites for clients, it is likely that you will have used both HTML and CSS to create your masterpiece.
HTML, created in 1990, has been the de facto standard for placing content on a web page. Over the years, it has evolved into what we now know as HTML5, which we can use to produce some very detailed websites or online applications. To use a cooking analogy, HTML is effectively the creation of the cake base; it is content that makes sense to any Internet browser. HTML forms the base of any website available on the Internet—it won't look very exciting, but it will have all the elements you need, such as headings, paragraphs, and images, to produce well-formed pages. Well-formed pages are made up of two elements: accessibility and validation.
Accessibility is the equivalent of building a new house, where we can add ramps or make doorways wider than normal to make it accessible for everyone. Basic accessibility isn't difficult or complex, but it must become a part of the development process; when left to its own devices, it will make it harder to move around the house, for those who need extra help to do so! In tandem with accessibility comes validation, which is very much like the Physics of cooking; if we work within the rules of validation, we can produce a masterpiece, while working outside of best practices is likely to lead to disaster.
It would be hard to produce a website without some form of decoration though; using HTML alone won't produce a very exciting effect! It's for this reason that we employ CSS to add final touches to our website, where we can tweak the positioning, add animation, or alter the colors of the elements on the page. Just as you can't build a house without cement, you can't produce a website without using CSS at some point in its creation.
Using CSS does not come without its limitations though—as it has evolved over the years, the support for its functionality has changed. One can argue that it has come a long way since its incarnation back in 1996, but at its very heart, it will always suffer from some core deficiencies. Let's take a look at these in more detail.