CSS basics

March 24, 2023
This blog post explains what many blog posts and articles online that can be found with a google search are going to state. The intended audience for this blog post is not professional computer programmers or those trying to learn to program in programming languages like C, C++, C#, Java, Javascript, PHP, and so on. It is still beneficial to understand the basics of how websites are styled even for those who are not tech-savvy. Since the late 1990s, CSS has been used to style the appearance of websites. Before that in the earlier days of the internet, every website was styled only by the default styling that was applied to each web browser.

elementname – This indicates that CSS styling should be applied to an HTML element such as an h1, h2, h3, a, span, and many more such HTML elements.

.classname – When a name comes after a period this indicates a class in HTML. Modern websites are not developed using CSS and HTML alone but using Javascript frameworks such as React, Angular, or Vue. But that is way beyond the scope of this blog post. A class as opposed to an id applied to an HTML element can apply to many elements. In HTML a class would be applied like the following example: <span class=”classnamehere”></span>. This is a span element that is meant to style a very specific set of text on a website. Usually, this is a few sentences on a website.

#idname – When a name comes after an asterisk this indicates an id in HTML. An id is similar to a class but an id is only meant to apply to a single HTML element.

*(global selector) – Changes made to CSS using this tag applies the CSS specified within the curly brackets to the whole HTML document.

An HTML element can have multiple classes and IDs applied to it. In CSS this would be indicated by the class names and ids printed together and not separated by any spaces. In CSS, this would be something like span.classname#id. This is a span element with a class and an id applied to it. This shouldn’t be confused with CSS styling with spaces between elements, classes, and ids such as span.classname #id. This style and element of a particular id is a child component of a span element with the specified class name.

For a more in depth discussion about CSS. Here is a link from a website for people learning programming.

To view, other blog posts from this website follow this link here.

Related Posts

A Comprehensive Guide to Flexbox

A Comprehensive Guide to Flexbox

Background Before diving into the details of Flexbox, let's understand its background and purpose. The Flexbox Layout module, also known as Flexible Box, is a W3C Candidate Recommendation. It aims to provide a flexible way to lay out, align, and distribute space among...

The evolution of the web: A Journey from Web 1.0 to Web 3.0

The evolution of the web: A Journey from Web 1.0 to Web 3.0

In the ever-changing landscape of the internet, the terms “Web 1.0,” “Web 2.0,” and “Web 3.0” are frequently used to describe different eras of online development. However, these terms are often misunderstood and used interchangeably. In this article, we will delve...

What is a Website?

What is a Website?

In today's digital age, a website plays a crucial role in establishing an online presence for individuals, businesses, and organizations. It serves as a platform to share information, promote products or services, connect with an audience, and facilitate various...

Call Now Button