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.
-
57:31
Candace Show Podcast
15 hours agoBREAKING! Taylor Swift Turns Against Blake Lively & Ryan Reynolds | Candace Ep 141
247K180 -
1:04:59
Sarah Westall
12 hours agoRFK Jr Report, Constitution Suspended, War Time Procedures in Place, WHO Exit, DOD w/ Sasha Latypova
85.1K50 -
1:56:37
Melonie Mac
16 hours agoGo Boom Live Ep 35!
72.3K15 -
1:01:13
LFA TV
19 hours agoPRESIDENT TRUMP SIGNS LAKEN RILEY ACT | BASED AMERICA 1.29.25 6pm
76.4K8 -
1:43:07
2 MIKES LIVE
13 hours ago2 MIKES LIVE #172 News Breakdown Wednesday!
42K2 -
1:26:16
The Big Mig™
14 hours agoJ6’r Ryan Samsel Free At Last The BOP & DOJ Exposed
40.3K4 -
31:34
The Based Mother
14 hours ago $2.50 earnedEXECUTIVE ORDER MUTILATES GENDER IDEOLOGY! Trump’s pulling out all the stops.
27.9K11 -
1:05:44
The Amber May Show
1 day ago $1.90 earnedSaving The Innocence | Rescuing Children From Rape Trafficking | Alan Smyth
27.2K4 -
1:40:46
In The Litter Box w/ Jewels & Catturd
1 day agoIs the Jab Poisonous? | In the Litter Box w/ Jewels & Catturd – Ep. 730 – 1/29/2025
93.3K48 -
2:06:16
Darkhorse Podcast
18 hours agoConfirmation of Cool: The 262nd Evolutionary Lens with Bret Weinstein and Heather Heying
101K63