HTML Course Hindi - Beginner to Pro ( 2023 ) | Chapter 4

Tag Attributes / Properties

<a href="https://www.w3schools.com">Visit W3Schools</a>
href is attributes → where we add url of website
There are various html tags who have other attributes
 

File Paths

notion image
If you want to locate files correctly inside html files then you should understand file path correctly

Apply CSS on HTML

Inline Style

notion image
You can directly apply css on html tag using style attribute
 

Internal Style

notion image
 
You can also apply styling in <style> </style> tags so that you don’t need to apply inline as inline code looks ugly.
you just need to select tags and you can apply styling on specific tag look above example.
 
 

External Styling

f you will use internal style length of file will be increase so it will be harder to mange html files.
hence we need to separate html and css file
 
look below image i have create style.css file where css is extension for CSS file
here we can exactly type code same as <style> tag code .
but incase of external file we need to link external css to html file.
 
notion image
 
To link css file we need to use <link> tag
<link rel=”stylesheet” href=”styles.css”/>
href is file path of css file
notion image
 
 

Class & ID

Tag Class

We Generally use class attributes on tag to assign specific class
using that assigned class we can apply css on that specific tag
notion image
using class we can reuse styling.
we just need to apply class on any tag to apply css properties.

Tag Id

Use id tag we can give specific name to any html tag
and using name/id we can select html tag in javascript file or css file
notion image
what is difference between id and class
id is unique . it can be only applied on only one specific tag
but class can be applied on multiple tags.