RadicalBlur's Website

radicalblur.neocities.org

112,962 views
35 followers
3,232 updates
0 tips
Hi! 'div id="something"' or 'div class="something"'? What'dya think is best for putting a label on an element and styling it?
1 like
radicalblur's avatar radicalblur 1 month ago

I use 'id' a lot, I'm not sure if it even matters. But I hear about 'class' being used more for styling elements while 'id" is used for Javascripting; getElementById

lemerks's avatar lemerks 1 month ago

I think i just use classes and thats it, cuz i saw it on w3schools.

2 likes
maxcrunch's avatar maxcrunch 1 month ago

I use id if it's used once and class if it's used more than once

1 like
wackyworkbench's avatar wackyworkbench 1 month ago

I usually use ids as my "main building blocks" and class as a "modifyer" to an existing element, like if I want larger text to be used as titles for sections I'll make a class for it so when I'm coding in the HTML it's "p class=" if that makes sense

1 like
kiwimeowo's avatar kiwimeowo 1 month ago

It depends, if theres only one “something”, i’ll use id, otherwise its class

1 like
kiwimeowo's avatar kiwimeowo 1 month ago

Using id is a bit easier for javascript as i dont need to add [0] at the end if i use class

1 like
radicalblur's avatar radicalblur 1 month ago

Interesting stuff.... thanks you all! I do it for the same reason as most of you; multiple elements that're the same and need the same styles

radicalblur's avatar radicalblur 1 month ago

I mostly use 'id' also because I save THREE LETTERS OF DISK SPACE YEAHHHHHHH WOOOOOOOOOOOOOOOOOOO! "class" is five letters long compared to 'id' - (me who compresses and optimizes stuff way too much)

Website Stats

Last updated 2 weeks ago
CreatedFeb 16, 2024
Site Traffic Stats

Tags

videogames webblog technology projects sonic