the web developer

The 21 Most Important Tools and Resources Used In Order to Develop a Website

The Internet today, is full of tools and resources, which can definitely help anyone develop a website. The timeframe that a developer spends on the site, will determine whether or not the website...


The 101 Most Useful Principles, Which Can Help Improve Your Life Forever

If we ever wondered why your life is not working as it you thought it should, it may be because you need to employ certain actions, which would take you to the next level. In today’s article, we...

Robot assisted surgery

Robot Assisted Surgery Will Change The Medical Field In Surgical Procedures

Robots are an amazing human invention, which we were able to accomplish due to the knowledge and understanding we have about the human body.

In today’s article we are going to talk about...

location based services

Location Based Services Are Changing The Way We Experience Mobile Devices

Our mobile world, has changed and will continue to change in the future; we need to be aware of these changes, so that they don’t catch us by surprise.

In today’s article, we are going to...

sd wan

Software Defined Wide Area Network, is The Future Of Network Infrastructure

Networking professionals have to now change their approach to networking design, due to the rapid change, that is happening in technology.

The introduction of cloud, the changes in IT...

Error message

Notice: Undefined variable: front_page in eval() (line 19 of /home/content/93/10477193/html/modules/php/php.module(80) : eval()'d code).

Mastering Cascading Style Sheet - Structuring Your Code - IDs and Classes


The power that technology has on us, is incredibly impossible to believe, and we don’t understand yet, how technology is manipulating the world, tremendously, but we will soon find out, the rules, which technology is using to be playing in this life, which we all are a part of.

If you want to become a professional in technology, in particular doing website and developing applications, you’d have to embark on a long journey, which only the fearless are able to take.

In today’s article we are going to talk about, CSS3 in particularly IDs and class names, to understand cascading styles sheets better.

An excellent foundation is provided by meaningful elements, and the list of available elements, is not exhaustive in website development.

The purpose of (X) HTML was to be a simple document markup language, but as technology progressed and continue to change, HTML5 contains many resources, which helps the designer work with the code better; therefore, becoming part of the language interface, of application or website development.

Existing elements are given extra meaning, with the addition of an ID or a class name, which adds structure, to your HTML document.

When you use IDs and classes in your HTML document, you will be provided with hooks, for your styles, and be able to control the style of several pages simultaneously, by changing one document, called the Cascading Style Sheet, or better known as the CSS document.

You could create your own custom navigation element, by taking a simple list of links, and giving it an ID name such as: navMain.

  • first item
  • second item
  • third item

If you would like to identify an individual element, on a page, such as the site navigation, an ID, which must be unique, can be used on this case.

Persistent structural elements, such as the main navigation, or content areas, are identified, by the use of IDs.

In order to avoid confusion, ID names, across the site, must be applied to conceptually, similar elements.

You will be able to avoid problems, when you want to style two similar elements, based on their context.

The use of distinct ID names, would make it much simpler, to style two contact forms, of the same elements, but different ID names, such as contactForms, and contactDetails.

One single ID can be applied to one element on the page; however, the same class, can be applied to any number of elements on the same page.

Types of content or similar items, can be identified using a class, such as dates on several news stories, which are the same on each page, a class, would be applied to identify these dates, because they would be styled the same as well.

Classes become very powerful, because they allow you to style several elements, at the same times, but you won’t have the ability to target elements, as you would do, with IDs.

Try to use meaningful names, when you are naming your IDs and classes as well, it will help you in your development.

Try to name your IDs and classes, with names, that explains, what the element is, rather than how it is presented.

Thank you for reading this article!!!