Extreme Programming

EXtreme Programming Methodology is The Most Effective Methodology in Software Development

The world of computers is amazing, and unless you are a person who is willing to go through to be thrown into parts of the world of computers, which does not feel amazing, then you will never be...

cyber security

Computer Forensics has Revolutionized the Justice Systems of The World

As our current world becomes more and more intertwined with technology, criminal activities are happening in the cyber world, and there must be a science to stop these crimes.

In today’s...

scrum methodology

The Scrum Methodology is A Framework that Helps The Development Life Cycle of Any Prodcut

In a scrum methodology, all the developers have to be committed to the project, and this may not be the case, because someone may just want to quit, or they may get fired.

In today’s...

agile methodology

The Exploration of The Agile Methodology In Large Projects

The computer world, is very interesting and people are catching up to it, when they want to develop software, because they are following techniques, which are useful for them to accomplish their...

agile environment

The Agile Methodology has Revolutionized The Information Technology World

The design and build activities for engineering, information technology, and a new product or service development projects, can be managed through the agile development methodology.

In...

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

css

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!!!