This forum is now read-only. Please use our new forums! Go to forums

banner
Close banner
0 points
Submitted by FightMeIRL
about 11 years

Can someone explain to me how this code works

id=’myID’ class=’myClass’>

i don’t completly understand what the id bit and the class bit does help please

Answer 5141627b6bb9ad50c0003708

4 votes

Permalink

The difference is ‘Single” vs “Many”.

ID’s are single use and are only applied to one element. They are used to identify a single element.

Classes can be used more than once. They can therefore be applied to more than one element, and more than once per element.

ID’s will work but when your ready to go validate your code with W3 Schools it will give your error warnings.

Only 1 ID to a element, but a element can have multiple Classes

<div id="myID" class="myFirstclass mySecondclass myThirdclass">
points
Submitted by Gabriel Pendleton
about 11 years

1 comments

Raahul Jaykar over 10 years

Answer 5225c324f10c60afb7006727

3 votes

Permalink

It would be best to show your code for HTML and CSS tabs however I can guess that you did not make an HTML element with the class fancy and then use CSS to apply the cursive font to it. For instance this would make a paragraph element with the class of “fancy”

<p class="fancy">This is cursive!</p>

which then we can style in CSS by selecting the class with the syntax “.[classname]” like so:

.fancy {
    font-family: cursive;
    color: #0000CD;
}
points
Submitted by shail26
over 10 years

1 comments

Raahul Jaykar over 10 years

Answer 513e6ccb4360cb42a900051e

0 votes

Permalink

It just means to specify certain elements if you want those specific ones with their own type of styling.

points
Submitted by Innocent
about 11 years

Answer 5140bd2810737088c1000658

0 votes

Permalink

From the examples and tests are the example names of intro, standout, just examples and you can use anything you want to describe it? Most of the times i put in my own word and then used that world in the CSS file to reference it, everything worked as it should.

points
Submitted by electricpoet41
about 11 years