The HTML class
attribute is used to specify a class for an HTML element.
Multiple HTML elements can share the same class.
Classes fully support inheritance, a fundamental characteristic of object-oriented programming. When you create a class, you can inherit from any other class that is not defined as sealed, and other classes can inherit from your class and override class virtual methods. Furthermore, you can implement one or more interfaces. With these Skillshare classes, you can explore a range of topics, tools, and techniques, from photography and graphic design, to drawing and animation.
The class attribute is often used to point to a class name in a style sheet. It can also be used by a JavaScript to access and manipulate elements with the specific class name. In the following example we have three elements with a class attribute with the value of 'city'. WARNING: XP does not count if you attack a decomposed Scroom or a house member. In alternative to progressing to an ultra, you can progress to 2 supers. These classes are known as hybrids. Uber Classes are the next step of progression after Ultra Classes, and can be obtained in Khei. 1 Base Classes 2 Super Classes 3 Ultra Classes 4 Uber Classes.
Using The class Attribute
The class
attribute is often used to point to a class name in a style sheet. It can also be used by a JavaScript to access and manipulate elements with the specific class name.
In the following example we have three <div>
elements with a class
attribute with the value of 'city'. All of the three <div>
elements will be styled equally according to the .city
style definition in the head section:
Example
<html>
<head>
<style>
.city {
background-color: tomato;
color: white;
border: 2px solid black;
margin: 20px;
padding: 20px;
}
</style>
</head>
<body>
<div>
<h2>London</h2>
<p>London is the capital of England.</p>
</div>
<div>
<h2>Paris</h2>
<p>Paris is the capital of France.</p>
</div>
<div>
<h2>Tokyo</h2>
<p>Tokyo is the capital of Japan.</p>
</div>
</body>
</html>
In the following example we have two <span>
elements with a class
attribute with the value of 'note'. Both <span>
elements will be styled equally according to the .note
style definition in the head section:
Example
<html>
<head>
<style>
.note {
font-size: 120%;
color: red;
}
</style>
</head>
<body>
<h1>My <span>Important</span> Heading</h1>
<p>This is some <span>important</span> text.</p>
</body>
</html>
Tip: The class
attribute can be used on any HTML element.
Note: The class name is case sensitive!
Tip: You can learn much more about CSS in our CSS Tutorial.
The Syntax For Class
To create a class; write a period (.) character, followed by a class name. Then, define the CSS properties within curly braces {}:
Example
Create a class named 'city':
<html>
<head>
<style>
.city {
background-color: tomato;
color: white;
padding: 10px;
}
</style>
</head>
<body>
<h2>London</h2>
<p>London is the capital of England.</p>
<h2>Paris</h2>
<p>Paris is the capital of France.</p>
<h2>Tokyo</h2>
<p>Tokyo is the capital of Japan.</p>
</body>
</html>
Multiple Classes
HTML elements can belong to more than one class.
To define multiple classes, separate the class names with a space, e.g. <div>. The element will be styled according to all the classes specified.
In the following example, the first <h2>
element belongs to both the city
class and also to the main
class, and will get the CSS styles from both of the classes:
Example
<h2>Paris</h2>
<h2>Tokyo</h2>
Different Elements Can Share Same Class
Different HTML elements can point to the same class name.
In the following example, both <h2>
and <p>
points to the 'city' class and will share the same style:
Example
<p>Paris is the capital of France</p>
Use of The class Attribute in JavaScript
The class name can also be used by JavaScript to perform certain tasks for specific elements.
JavaScript can access elements with a specific class name with the getElementsByClassName()
method:
Example
Click on a button to hide all elements with the class name 'city':
function myFunction() {
var x = document.getElementsByClassName('city');
for (var i = 0; i < x.length; i++) {
x[i].style.display = 'none';
}
}
</script>
Don't worry if you don't understand the code in the example above.
You will learn more about JavaScript in our HTML JavaScript chapter, or you can study our JavaScript Tutorial.
Chapter Summary
- The HTML
class
attribute specifies one or more class names for an element - Classes are used by CSS and JavaScript to select and access specific elements
- The
class
attribute can be used on any HTML element - The class name is case sensitive
- Different HTML elements can point to the same class name
- JavaScript can access elements with a specific class name with the
getElementsByClassName()
method
HTML Exercises
Classes is a collective name for the seven playable characters available to the player in Diablo II and the expansion Diablo II: Lord of Destruction. Each class features a different model and animations, speech, skill set and breakpoints, but otherwise they all follow the same story and general game mechanics. The differences however, particularly the different skill setups, lead to very distinct playstyles that are often described in various builds.
Every class can also hire one of four different Hirelings available in the game to follow them through the game.
General Mechanics
All classes have a lot of features in common.
- There are four attributes: strength, dexterity, vitality and energy. Strength determines melee physical damage (very minor) and acts as a requirement for most gear. Dexterity determines ranged physical damage, Attack Rating and as a requirement for some weapons. Vitality determines life and stamina and energy determines mana.
- All characters have 30 skills spread across three different skill trees. All characters have unique skills that are not shared with any other character, even though some are quite similar to each other like Inferno and Arctic Blast.
- With the exception of some class-specific gear (one kind for each class) all characters can equip every type of item in the game provided they meet the item's stat requirements.
Classes
Amazon | Assassin | Barbarian | Druid | Necromancer | Paladin | Sorceress | |
---|---|---|---|---|---|---|---|
Game | Classic | Expansion | Classic | Expansion | Classic | Classic | Classic |
Skill Trees | Javelin and Spear Skills Passive and Magic Skills Bow and Crossbow Skills | Martial Arts Shadow Disciplines Traps | Warcries Combat Masteries Combat Skills | Elemental Shape Shifting Summoning | Summoning Spells Poison and Bone Spells Curses | Defensive Auras Offensive Auras Combat Skills | Cold Spells Lightning Spells Fire Spells |
Minions | One at a time | One at a time | None | Several | Many | None | None |
Class Characteristics
Though there are many unconventional builds that can use weird skill and gear combinations, the most popular builds typically fit the archetype and intended function of the class.
The Amazon is a warrior who fights with the bow or spear. The strongest builds are the ranged ones that utilize the bow, crossbow or javelin, while the spear builds are more risky due to the lack of a shield and the added protection it would bring. The attacks themselves are either fire or cold attacks for the bow and crossbow, or lightning and poison attacks for the spear and javelin. Both focuses also allows for pure physical attack skills. The passive abilities either augment the attack skills of the Amazon - whether ranged or melee - or provide ways for her to keep enemies off her, such as Decoy and Valkyrie.
The Assassin uses a distinct mechanic in the Martial Arts tree that involves charge up moves and finishing attacks: the Assassin can power up with up to three charges and release the charges with various finishing moves for a host of different effects. The Shadow tree contains passive abilities, such as a skill that allows the Assassin to block attacks with claw weapons instead of a shield, and the ability to create a duplicate of the Assassin that can utilize her skills. The Trap tree allows the Assassin to throw deadly projectiles, including blades and bombs, and also includes several fire and lighting sentries that work much like the skills of the Sorceress but originating from a thrown stationary item rather than a spell.
The Barbarian is the heaviest melee class with many melee skills and passive abilities for survivability. The Barbarian is the only class who can dual wield melee weapons (apart from an Assassin using claw weapons). The Combat Skills contains the attack skills, and allows for specialization in either one weapon (either two-handed or with a shield), two weapons or two throwing weapons. The Masteries tree contains exclusively passive skills that boost both offensive and defensive stats of the Barbarian, and the Warcries are temporary buffs the Barbarian can apply to himself and allies. Any number of warcries can be active at one time, further boosting the Barbarian's ability to boost his own stats as well as managing monsters.
The Druid requires the most specialization of all classes, as each of his trees provide for unique play mechanics. Elemental makes him a caster that creates earthquakes, hurricanes and other spells based on nature. The Shape Shifting tree allows him to become either a Werewolf based on speed or Werebear based on power, and makes him a dangerous melee combatant. The Summoning tree allows him to summon wolves, crows, a bear, creeping vines, and several spirits that provide buffs similar to the Paladin's auras.
The Necromancer is a pure caster focusing on the dead. In the summoning tree he can raise skeletons, create golems and revive dead enemies, while the Poison and Bone path makes him a more direct damage caster with poison and magic abilities. Curses are debuffs that can be cast on enemies to create a host of effects, such as increasing their damage taken and slowing them down.
The Paladin is a holy warrior and the second focused melee class. He excels while using a shield. He can use one aura at a time that provides a persistent bonus to him and his party members. Defensive helps him survive attacks, while offensive boosts his ability to inflict damage. The combat skills tree serves a similar function to the Barbarian's combat skills, but the tree is broken up between melee skills, shield skills, and magic attacks.
The Sorceress is the second caster class who focuses exclusively on elemental attacks from the elements of fire, cold, and lightning. Each tree offers different benefits: fire provides high reliable damage, cold slightly less damage but also slows enemies, and lightning provides the highest potential damage but has a large damage variance. Each tree contains some support skills in addition to the multitude of attack skills she possesses.
Classes Eso
Official Classes | ||
---|---|---|
Diablo III | Barbarian • Crusader • Demon Hunter • Monk • Necromancer • Witch Doctor • Wizard | |
Diablo II | Amazon • Assassin • Barbarian • Druid • Necromancer • Paladin • Sorceress | |
Diablo I & Hellfire | Barbarian • Bard • Monk • Rogue • Sorcerer • Warrior |