HTML & CSS for Beginners Part 4: Bold and Italic text and HTML comments

Kevin Powell · Beginner ·🌐 Frontend Engineering ·9y ago
Skills: HTML & CSS90%

Key Takeaways

This video covers HTML and CSS basics, specifically how to make text bold and italic using the strong and em tags, as well as how to add comments to HTML code.

Full Transcript

hey you're watching part 4 of a series on HTML and CSS for beginners in this video we're gonna see how to make our text bold and italic as well as how we can add comments to our code that the browser's won't read so as you can see on the screen I've already gone ahead and added a bit of content here just to add a few paragraphs of text so to make bold text and italic text sadly it's not like our paragraphs with a P and headings or with H tags and they made it a little bit different and it's because we it's not necessarily about making things bold or italic but it's about putting more emphasis and more importance on our text so what I'm going to do is I want to make this first sentence here so the first sentence right here bold and to do that you want to use something called a strong tag and then I'm going to come all the way to here and I have to close my strong tag I'm gonna save this and we'll refresh and there you can go you can see that everything has become bold that was inside my strong tag so just to do that again we'll do it on the last sentence in this paragraph strong and then I come all the way over here close strong and let's refresh and now you can see this has also become strong or bold just to show you what's important to close your strong tag if ever you forgot to close your strong tag everything becomes bold it's not going to end at the end of this paragraph it just keeps going until the end of your document so make sure you close your strong tags and that should be a close forward slash there we go so let's come down to our second paragraph now and look at italic text so just like the strong tag we're making our text stronger we're making putting you know it's bigger it's more important italic text the whole idea behind it alakazoo even put emphasis on our text so what we use for that is an e/m tag and that stands for emphasis so let's just do this whole first sentence close um save that and refresh and we can see here that it's become italic let me just zoom in a bit on the screen so we can see our text has become italic there now we're just learning HTML and CSS so maybe you'd look at this later and go oh man I forget what the M stands for so let's look at doing what we can HTML comment so I'm just going to come up here in this empty space here and I'm gonna put in a triangle bracket exclamation mark - - and you can see everything after that now is becoming gray and this is an HTML comment - - closed triangle bracket and what that's doing is its closing my comment so it's not like a regular thing we have to tell it that it's a comment so it's not just with my greater than and less than symbols or my triangle brackets it's using this is telling it that it's the start of a comment and this is telling it it's the end of a comment and if I save my document and I refresh we won't see any differences here the comments are just notes to yourself or other people who are reading your code so what you could do is you could say in here the M stands for emphasis this makes my text italic and up here we could put in another one strong makes my tech whoops makes my text bold and there we go think it's important we want to put a space here in here it will still work if you do that but it's possible you run and do some issues depending on what symbols you have at the end so always just do your opening we do our exclamation mark - - put in all over a comment sorry put in a space put in your comment space and then put in the two hyphens and the triangle bracket there again I'm gonna save my document and refresh and again you can see that there's no change there another thing you can do if you want bold italic text is you can put in M and I can come here and do a close M save that and refresh and you can see that it becomes bold italic now of course I don't need all of my text to be strong and bold I could take this M tag here and maybe only make these last two words so all of this is bold then this is bold and italic and then we close it all off so it's regular bold then I have my bold italic and they both close right there and then if I needed to I could come down here and put in yet another strong tag and I kept it close strong and then over here I could come and put another mm tag and I could close em safe so there's my bold text over here is my next italic text and so on and so forth just as a quick side note if you're looking online for some tutorials and stuff you might see something called a bee tag close bee and let's do this next word here I and I'll close my eye over here I'll save that and you'll notice that it's actually working so this word here is right there it's bold and this here is my italic text here bee and I are obviously much faster to write and easier to do the problem is they have no meaning behind them it's a visual representation of bold and italic but it doesn't actually add importance to your text and this is important these days one of the things we have to worry about with Web Design is accessibility there's going to be people who are visiting your website that can't see the screen very well they might have something called a screen reader that which reads the website to them and this takes strong and em into importance for putting more importance and emphasis on our text whereas the B&I tags don't add any importance to the text it's a visual representation but it doesn't do it doesn't actually add meaning to our text just like an h1 it actually adds meaning it's telling the browser that this is a title it's not just making it bigger it's it's giving it real meaning the strong M tags give things real meaning that's add another little comment here just as a reminder to yourself do not use B and I they're not what we want to be using so they're actually used for a few other things now for little hacks that you might find and you might see those later on as you explore web development a bit more but for the most part we just pretend they don't exist strong em that's the right way to go so thanks so much for watching up until now I really hope you like this video if you have any comments any questions leave them down below in the comment section and next video we're going to be looking at links we're actually in ads and interactivity to our site by linking to other pages and that should be a lot of fun I look forward to seeing you there [Music]

Original Description

A look at how to make your text bold and italic in HTML. This video is part of a large series introducing HTML & CSS to people who have never used it before. The goal of this series is to give you a good enough understanding of HTML and CSS to let you build your first website on your own! ---- Half Bit by Kevin MacLeod is licensed under a Creative Commons Attribution licence (https://creativecommons.org/licenses/by/4.0/) Source: http://incompetech.com/music/royalty-free/?keywords=%22half+bit%22 Artist: http://incompetech.com/
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Kevin Powell · Kevin Powell · 5 of 60

1 How to create an awesome navigation bar with HTML & CSS
How to create an awesome navigation bar with HTML & CSS
Kevin Powell
2 Improve your CSS by Keepin' it DRY
Improve your CSS by Keepin' it DRY
Kevin Powell
3 HTML & CSS for Beginners Part 6: Images
HTML & CSS for Beginners Part 6: Images
Kevin Powell
4 HTML & CSS for Beginners Part 7: File Structure
HTML & CSS for Beginners Part 7: File Structure
Kevin Powell
HTML & CSS for Beginners Part 4: Bold and Italic text and HTML comments
HTML & CSS for Beginners Part 4: Bold and Italic text and HTML comments
Kevin Powell
6 HTML & CSS for Beginners Part 5: Links
HTML & CSS for Beginners Part 5: Links
Kevin Powell
7 HTML & CSS for Beginners Part 3: Paragraphs and Headings
HTML & CSS for Beginners Part 3: Paragraphs and Headings
Kevin Powell
8 HTML and CSS for Beginners Part 1: Introduction to HTML
HTML and CSS for Beginners Part 1: Introduction to HTML
Kevin Powell
9 HTML and CSS for Beginners Part 2: Building your first web page!
HTML and CSS for Beginners Part 2: Building your first web page!
Kevin Powell
10 HTML & CSS for Beginner Part 8: Introduction to CSS
HTML & CSS for Beginner Part 8: Introduction to CSS
Kevin Powell
11 HTML & CSS for Beginners Part 9: External CSS
HTML & CSS for Beginners Part 9: External CSS
Kevin Powell
12 HTML & CSS for Beginners Part 10: Divs & Spans
HTML & CSS for Beginners Part 10: Divs & Spans
Kevin Powell
13 HTML & CSS for Beginners Part 11: Classes & IDs
HTML & CSS for Beginners Part 11: Classes & IDs
Kevin Powell
14 HTML & CSS for Beginners Part 12: The CSS Box Model - Margin, Borders & Padding explained
HTML & CSS for Beginners Part 12: The CSS Box Model - Margin, Borders & Padding explained
Kevin Powell
15 HTML & CSS for Beginners Part 13: Background Images
HTML & CSS for Beginners Part 13: Background Images
Kevin Powell
16 HTML & CSS for Beginners Part 14: Style Text with CSS
HTML & CSS for Beginners Part 14: Style Text with CSS
Kevin Powell
17 HTML & CSS for Beginners Part 15: How to style links
HTML & CSS for Beginners Part 15: How to style links
Kevin Powell
18 HTML & CSS for Beginners Part 16: CSS selectors and Specificity
HTML & CSS for Beginners Part 16: CSS selectors and Specificity
Kevin Powell
19 HTML & CSS for Beginners Part 17: How to Create and Style HTML Lists
HTML & CSS for Beginners Part 17: How to Create and Style HTML Lists
Kevin Powell
20 HTML & CSS for Beginners Part 18: How Floats and Clears work
HTML & CSS for Beginners Part 18: How Floats and Clears work
Kevin Powell
21 HTML & CSS for Beginners Part 19: Colors with CSS - hex, rgba, and hsla
HTML & CSS for Beginners Part 19: Colors with CSS - hex, rgba, and hsla
Kevin Powell
22 HTML & CSS for Beginners Part 20: How to center a div
HTML & CSS for Beginners Part 20: How to center a div
Kevin Powell
23 HTML & CSS for Beginners Part 21: How to create a basic website layout - the HTML
HTML & CSS for Beginners Part 21: How to create a basic website layout - the HTML
Kevin Powell
24 HTML & CSS for Beginners Part 22: How to create a basic layout - the CSS
HTML & CSS for Beginners Part 22: How to create a basic layout - the CSS
Kevin Powell
25 How to Create a Responsive Website from Scratch - Part 1: The HTML #Responsive #HTML5
How to Create a Responsive Website from Scratch - Part 1: The HTML #Responsive #HTML5
Kevin Powell
26 How to Create a Responsive Website from Scratch - Part 2: The Header and Hero area #Responsive #CSS3
How to Create a Responsive Website from Scratch - Part 2: The Header and Hero area #Responsive #CSS3
Kevin Powell
27 How to Create a Responsive Website from Scratch - Part 3: The About Section #Responsive #CSS
How to Create a Responsive Website from Scratch - Part 3: The About Section #Responsive #CSS
Kevin Powell
28 How to Create a Responsive Website from Scratch - Part 4: Building a Responsive Portfolio Section
How to Create a Responsive Website from Scratch - Part 4: Building a Responsive Portfolio Section
Kevin Powell
29 How to Create a Responsive Website from Scratch - Part 5: Call To Action and Footer #CSS #Responsive
How to Create a Responsive Website from Scratch - Part 5: Call To Action and Footer #CSS #Responsive
Kevin Powell
30 Tutorial: Learn how to use CSS Media Queries in less than 5 minutes
Tutorial: Learn how to use CSS Media Queries in less than 5 minutes
Kevin Powell
31 End of the year upate and what's coming to my channel to start the new year
End of the year upate and what's coming to my channel to start the new year
Kevin Powell
32 Create a CSS only Mega Dropdown Menu
Create a CSS only Mega Dropdown Menu
Kevin Powell
33 CSS Tutorial: Outline and Outline Offset
CSS Tutorial: Outline and Outline Offset
Kevin Powell
34 CSS Blending Modes
CSS Blending Modes
Kevin Powell
35 Parallax effect | 2 different ways to add it with jQuery
Parallax effect | 2 different ways to add it with jQuery
Kevin Powell
36 CSS Units: vh, vw, vmin, vmax #css #responsive #design
CSS Units: vh, vw, vmin, vmax #css #responsive #design
Kevin Powell
37 How to Create a Website - Complete workflow | Part 01: Intro + Setting things up
How to Create a Website - Complete workflow | Part 01: Intro + Setting things up
Kevin Powell
38 100 Subscribers speed coding bonus video
100 Subscribers speed coding bonus video
Kevin Powell
39 How to Create a Website - Complete workflow | Part 02: The Markup #HTML
How to Create a Website - Complete workflow | Part 02: The Markup #HTML
Kevin Powell
40 How to Create a Website - Complete workflow | Part 03: Sass Variables and a Mixin #Sass
How to Create a Website - Complete workflow | Part 03: Sass Variables and a Mixin #Sass
Kevin Powell
41 How to Create a Website - Complete workflow | Part 04: Setting up the hero and header
How to Create a Website - Complete workflow | Part 04: Setting up the hero and header
Kevin Powell
42 How to Create a Website - Complete workflow | Part 05: Typography & Buttons
How to Create a Website - Complete workflow | Part 05: Typography & Buttons
Kevin Powell
43 How to Create a Website - Complete workflow | Part 06.1: Building the navigation with Flexbox
How to Create a Website - Complete workflow | Part 06.1: Building the navigation with Flexbox
Kevin Powell
44 How to Create a Website - Complete workflow | Part 06.2: Making the nav work with jQuery
How to Create a Website - Complete workflow | Part 06.2: Making the nav work with jQuery
Kevin Powell
45 Redesigning & Coding My Website #CreateICG
Redesigning & Coding My Website #CreateICG
Kevin Powell
46 How to Create a Website - Complete workflow | Part 07: Starting the flexbox grid
How to Create a Website - Complete workflow | Part 07: Starting the flexbox grid
Kevin Powell
47 How to Create a Website - Complete workflow | Part 08: Promo & Problem shooting!
How to Create a Website - Complete workflow | Part 08: Promo & Problem shooting!
Kevin Powell
48 How to Create a Website - Complete workflow | Part 09: The CTA and Footer
How to Create a Website - Complete workflow | Part 09: The CTA and Footer
Kevin Powell
49 How to Create a Website - Complete workflow | Part 10: Making it responsive
How to Create a Website - Complete workflow | Part 10: Making it responsive
Kevin Powell
50 How to Create a Website - Complete workflow | Part 11: Making it responsive con't
How to Create a Website - Complete workflow | Part 11: Making it responsive con't
Kevin Powell
51 How to Create a Website - Complete workflow | Part 12: Putting the site online
How to Create a Website - Complete workflow | Part 12: Putting the site online
Kevin Powell
52 Create a Custom Grid System with CSS Calc() and Sass
Create a Custom Grid System with CSS Calc() and Sass
Kevin Powell
53 CSS em and rem explained #CSS #responsive
CSS em and rem explained #CSS #responsive
Kevin Powell
54 Should you use Bootstrap?
Should you use Bootstrap?
Kevin Powell
55 How to add Smooth Scrolling to your one page website with jQuery
How to add Smooth Scrolling to your one page website with jQuery
Kevin Powell
56 Let's learn Bootstrap 4
Let's learn Bootstrap 4
Kevin Powell
57 How I approach designing a website - my thought process
How I approach designing a website - my thought process
Kevin Powell
58 Build a website with Bootstrap 4 - Part 1: The setup
Build a website with Bootstrap 4 - Part 1: The setup
Kevin Powell
59 Build a website with Bootstrap 4 - Introduction
Build a website with Bootstrap 4 - Introduction
Kevin Powell
60 Build a website with Bootstrap 4 - Part 2:  Customizing Variables
Build a website with Bootstrap 4 - Part 2: Customizing Variables
Kevin Powell

This video teaches how to make text bold and italic in HTML using the strong and em tags, and how to add comments to HTML code. It also covers the importance of accessibility in web development.

Key Takeaways
  1. Use the strong tag to make text bold
  2. Use the em tag to make text italic
  3. Add comments to HTML code using the <!-- --> syntax
  4. Avoid using the b and i tags for bold and italic text
  5. Use the strong and em tags for accessibility
💡 The strong and em tags not only make text bold and italic, but also add importance and emphasis to the text, which is important for accessibility.

Related AI Lessons

Had my Frontend Developer interview with Capgemini (Application Developer) today, and I wanted to…
Prepare for a frontend developer interview with Capgemini by reviewing JavaScript fundamentals and practicing common interview questions
Medium · JavaScript
10 Frontend Developer Tools to Boost Productivity in 2026
Boost frontend productivity with 10 essential tools for modern web app development
Medium · Programming
10 Frontend Developer Tools to Boost Productivity in 2026
Boost frontend productivity with top 10 developer tools in 2026
Medium · JavaScript
The US Frontend Engineer Market in 2026: A Data-Driven Reality Check (and the Bias That Stops Us Seeing It)
US frontend engineer hiring demand peaked in 2022 and remains flat-depressed in 2026, contrary to common assumptions
Dev.to AI
Up next
The masks we wear | Zora Krstić | TEDxLuxembourgCity
TEDx Talks
Watch →