Premium Only Content
Styling with CSS by Id and Class Selectors plus Bootstrap Button Example
The lecture shows you how to select an HTML element for styling with CSS using its id or class attribute instead of using the type selector that targets all elements of a specific name.
Using a type selector is usually not the best practice because HTML web pages usually have hundreds of elements and changing all of them at once to comfort to a specific style might cause inconsistencies in the design.
You can select a specific element for styling with CSS using its id attribute. Only one, and only one, element may have that unique identifier.
If you need to select multiple elements for styling under the same ruleset, you can use the class attribute. It turns out using a class is usually the most popular and safe choice for best practice. When in doubt, just use a class.
The lecture also gives the example of leveraging CSS code already written by somebody else, like the Bootstrap design system. Because the class definitions are already written for you, all you have to do is use the class name if you want to adopt the same style for your web page element, provided you link the Bootstrap spreadsheet to make it available in your document.
-
22:01
DeVory Darkins
1 day ago $36.29 earnedHakeem Jeffries SHUTS DOWN The View as Matt Gaetz Speaks out
80.8K127 -
2:02:54
Mally_Mouse
14 hours agoLet's Play!! - Spicy Saturday
60.3K2 -
1:33:06
Slightly Offensive
15 hours ago $30.74 earnedAre You Ready for What's Coming Next? | Just Chatting Chill Stream
77.2K42 -
32:10
MYLUNCHBREAK CHANNEL PAGE
1 day agoThe Gate of All Nations
148K63 -
13:07
Sideserf Cake Studio
19 hours ago $3.86 earnedIS THIS THE MOST REALISTIC SUSHI CAKE EVER MADE?
64.6K4 -
21:08
Clownfish TV
1 day agoElon Musk Tells WotC to BURN IN HELL for Erasing Gary Gygax from DnD!
52.1K16 -
48:22
PMG
15 hours ago $11.57 earned"IRS Whistleblowers Speak Out on Biden Family with Mel K In-Studio"
41.6K25 -
2:59
BIG NEM
17 hours agoLost in the Wrong Hood: Who Do I Check In With?
31.2K4 -
1:29:32
I_Came_With_Fire_Podcast
1 day ago"UFOs, Nukes, & Secrecy: Bob Salas on the 1967 Malmstrom Incident, UAPs, & Disclosure"
142K29 -
1:57:05
The Quartering
20 hours agoElon Musk To BUY MSNBC & Give Joe Rogan A Spot, MrBeast Responds Finally To Allegations & Much More
137K113