The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Why are there some really long class names?
wdgjunkie
post May 30 2018, 11:37 AM
Post #1





Group: Members
Posts: 2
Joined: 30-May 18
Member No.: 26,652



Hello there,

I'm fairly new to programming, so please excuse my ignorance. As I'm perusing different websites studying the different html/css syntax, I am coming across the typical "container," "header," etc. classes which I am understanding, but I am also finding some very ornate, long-winded class names such as:

CODE
<body class="home blog tm-isblog wp-home wp-front_page" data-gr-c-s-loaded="true">


or

CODE
<div class="uk-navbar-content uk-navbar-center uk-visible-small">


or

CODE
<section class="tm-top-a uk-grid tm-grid-block" data-uk-grid-match="{target:'> div > .uk-panel'}">



I am just curious as to why a developer would choose to name a class to such a degree instead of something much simpler. Could someone help me understand the reasoning behind this, as well as how I am supposed to know how to name the class when a name this descriptive is in order?

This post has been edited by wdgjunkie: May 30 2018, 11:39 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
Christian J
post May 31 2018, 02:19 PM
Post #2


.
********

Group: WDG Moderators
Posts: 9,661
Joined: 10-August 06
Member No.: 7



Another thing to watch out for is name collisions, especially if you're a template designer or one of the poor souls blindly embedding every third-party resource they've ever heard of. mellow.gif

To avoid collisions it might be good to use prefixes (and hope nobody else is using the same one as you).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 27th April 2024 - 12:41 PM