So, I’ve told you what CSS isn’t. What is it? What does CSS do?
A CSS file sits on a server just like any other file, just like the HTML file. You have an HTML file that has stuff in it, and then a CSS file that references the stuff in the HTML file and tells it what to do. You could also reference multiple things in multiple HTML files, as long as the things have the same name.
I didn’t make anything in the CSS file, as you can see, the table with the random blocks of latin text was already there. I made the table in the HTML file and modified it in the CSS file.
And the font face of text inside tables isn’t the only thing you can alter with CSS. You can alter background color, width, height, transparency, alignment and a variety of other things (there is a specific list of properties that you can change with CSS, not to mention some proprietary ones not part of standard CSS). And you can modify not just text, but, paragraphs, hyperlinks, divs, the entire page’s background, so many things. However, this is where I start stepping on the territory of other CSS tutorials, so I will just leave you with that.
I have recently been doing a lot of work related to CSS files recently at my Web Designer job at NAVAIR. There seems to be some confusion about what CSS is and what it does. Very few documents exist that explicitly and unambiguously state what CSS does. Doing a few search engine searches, I could not find any documents at all that explain CSS with a level of specificity that is to my satisfaction, so I am stepping forward to post my thoughts on the topic.
If you want to know how to build a good website with CSS, some common tips and tricks for making pretty websites with CSS, or the history of CSS, that kind of stuff is already covered elsewhere on other sites rather well, so I will not be discussing that.
CSS files are essentially just files with a bunch of code in them (just like an HTML file); simple files that can be altered in any plain text editor. CSS files can be used in conjunction with a few different types of files, but are most commonly used in conjunction with HTML files, therefore that will be the context within which I will talk about them.
Allow me to inform you of some misconceptions:
CSS is not an all-encompassing “look and feel” solution for websites. If a web designer is given the task of editing an already-existing website and making major changes to it, he will most likely need to edit more than just the CSS files. CSS does not change the design elements of a website; it is simply a tool a web designer can use to assist in changing the design elements of a website.
CSS is not a proprietary software package or content management system.CSS is simply a type of file. There are no limitations on what it can do, other than how the browser interprets the code.
CSS does not add new elements to a web page’s layout.I cannot emphasize this enough. CSS cannot make things (it also can’t destroy things). It only alters the properties of what’s already there. You can’t make new things; you can only make changes to the things that already exist. The “things” in a web page’s layout are created in the HTML file. After they are created, then their properties can be modified by a CSS file.
CSS is not mandatory. A website does not have to have CSS files in order to function. Some websites don’t have any CSS files or CSS code of any kind and some utilize other means for controlling the visual appearance of the website. And by that I mean, some sites are entirely Flash, which I recommend against. Websites should use CSS, but CSS is not some silver bullet that just does everything. A good website requires a holistic view, a vision- overseen by a competent individual or group of individuals.