HTML Tutorial: Ids & Classes in HTML | Web Development Tutorials #10

HTML Tutorial: Ids & Classes in HTML | Web Development Tutorials #10

Understanding Id's and Classes in HTML

In this section, the instructor explains the concept of ideal classes and how to add boilerplate. They also discuss the difference between id's and classes in HTML.

Adding Boilerplate

  • To add boilerplate, type "!" followed by "tab" key.
  • This will generate a basic HTML structure.

Understanding Id's

  • An id is a unique identifier given to an element in HTML.
  • It is used to identify elements uniquely on a page.
  • With JavaScript, you can target one element using its id.

Understanding Classes

  • A class is a way to group multiple elements together.
  • You can define properties for all elements with the same class name at once using CSS.

Key Takeaways

  • An id is used to identify an element uniquely on a page while a class is used to group multiple elements together.
  • With JavaScript, you can target one element using its id while with CSS, you can define properties for all elements with the same class name at once.

Introduction to Classes and Emmet

In this section, the instructor introduces classes and explains how they work in HTML. The instructor also demonstrates how to use Emmet to write HTML code faster.

Understanding Classes

  • A class is a way of defining multiple properties for an element in CSS.
  • Multiple classes can be added to one element by separating them with spaces.
  • An ID can only be used once per page, while a class can be used multiple times.

Introduction to Emmet

  • Emmet is a shortcut for writing HTML code quickly.
  • Use "." for classes and "#" for IDs when using Emmet.
  • If no tag is specified, Emmet defaults to using "div".
  • Multiple elements can be created using Emmet by separating them with commas.

Overall, this section provides an introduction to classes and how they work in HTML. The instructor also demonstrates how to use Emmet as a tool for writing HTML code more efficiently.

Using Emmet to Create Multiple Elements

In this section, the speaker explains how to use Emmet to create multiple elements in HTML. They demonstrate how to define classes and IDs and explain the difference between them.

Using Emmet for Multiple Elements

  • To print four similar elements using Emmet, type "multiply by 4" after the element name.
  • Classes can be defined by adding a period before the class name, while IDs are defined by adding a pound sign before the ID name.
  • Classes can be used for multiple elements, while IDs are unique to one element only.

Defining Properties with CSS

  • The speaker explains that properties such as background color and font can be defined using CSS by targeting classes or IDs.
  • If a class is not given any properties in CSS, it will not affect any elements on the page.

Conclusion

The speaker emphasizes that Visual Studio Code supports Emmet and makes it easy to use when creating websites. They encourage viewers to like and comment on their videos and bookmark their playlist for future reference.

Video description

► Source Code & Notes: https://archive.codewithharry.com/videos/web-development-in-hindi-10 ►This video is a part of this Complete Web Development in Hindi Course Playlist: https://www.youtube.com/playlist?list=PLu0W_9lII9agiCUZYRsvtGTXdxkzPyItg ►Click here to subscribe - https://www.youtube.com/channel/UCeVMnSShP_Iviwkknt83cww ►Checkout my English channel here: https://www.youtube.com/ProgrammingWithHarry Best Hindi Videos For Learning Programming: ►Learn Python In One Video - https://www.youtube.com/watch?v=ihk_Xglr164 ►Python Complete Course In Hindi - https://www.youtube.com/playlist?list=PLu0W_9lII9agICnT8t4iYVSZ3eykIAOME ►C Language Complete Course In Hindi - https://www.youtube.com/playlist?list=PLu0W_9lII9aiXlHcLx-mDH1Qul38wD3aR&disable_polymer=true ►JavaScript Complete Course In Hindi - https://www.youtube.com/playlist?list=PLu0W_9lII9ajyk081To1Cbt2eI5913SsL ►Learn JavaScript in One Video - https://www.youtube.com/watch?v=onbBV0uFVpo ►Learn PHP In One Video - https://www.youtube.com/watch?v=xW7ro3lwaCI ►Django Complete Course In Hindi - https://www.youtube.com/playlist?list=PLu0W_9lII9ah7DDtYtflgwMwpT3xmjXY9 ►Machine Learning Using Python - https://www.youtube.com/playlist?list=PLu0W_9lII9ai6fAMHp-acBmJONT7Y4BSG ►Creating & Hosting A Website (Tech Blog) Using Python - https://www.youtube.com/playlist?list=PLu0W_9lII9agAiWp6Y41ueUKx1VcTRxmf ►Advanced Python Tutorials - https://www.youtube.com/playlist?list=PLu0W_9lII9aiJWQ7VhY712fuimEpQZYp4 ►Object Oriented Programming In Python - https://www.youtube.com/playlist?list=PLu0W_9lII9ahfRrhFcoB-4lpp9YaBmdCP ►Python Data Science and Big Data Tutorials - https://www.youtube.com/playlist?list=PLu0W_9lII9agK8pojo23OHiNz3Jm6VQCH Follow Me On Social Media ►Website (created using Flask) - http://www.codewithharry.com ►Facebook - https://www.facebook.com/CodeWithHarry ►Instagram - https://www.instagram.com/codewithharry/ ►Personal Facebook A/c - https://www.facebook.com/geekyharis Twitter - https://twitter.com/Haris_Is_Here