TechCodex
creator
link
fedilink
English
17
edit-2
1Y

In HTML:

div class=“hands”>

In CSS:

.hands

A dot in CSS means you’re referring to an HTML Class. Note that this is different from the OOP Class in scripting languages. Think of HTML classes as classrooms. You can have multiple divs with the same class name, each will be affected when you style that class name. Just like students follow the same rule when applied to a classroom.

In some specific instances, ID is used instead of class. # is used in CSS instead of a dot. The only difference is that in ID, each element should have a unique ID.

div id=“right-arm”

CSS: #right-arm

Thank you for the detailed explanation! One more question: what is the usage of the dor in an OOP language? Or at least, what is the usage refered to as so I can actually look it up haha

@nero@lemmy.world
link
fedilink
English
61Y

To add onto this, you can also have:

<div> </div>

And style it with:

div { background-color: red; }

just using the html tags without a . or #

Create a post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
  • 1 user online
  • 120 users / day
  • 257 users / week
  • 744 users / month
  • 3.72K users / 6 months
  • 1 subscriber
  • 1.48K Posts
  • 32.6K Comments
  • Modlog