how to link css to html | link css to html
Today we will be taking a look at how we can link external CSS into our HTML document.
Before we kick off our topic lets take a look at External CSS what it is and why do we need it.
what is css
Cascading Style Sheets commonly known as CSS is language used for styling the Web pages. By default the browsers have vary basic styling only for readability purpose ,with CSS the HTML document gets an attractive look.
There are three ways we can use CSS in HTML documents.
- Inline CSS
- Internal CSS
- External CSS
what is inline css –
Inline CSS is used to style a specific HTML Element . Observe the following example and try to change the properties .
what is Internal CSS –
Internal CSS also known as Embedded CSS . It is used when developer is working with a single page HTML Document page.
Internal CSS is defined in the head tag(<head>) of HTML Document using style tag (<style>).
Observe the following example for better understanding:
External CSS –
What is External CSS ?
A separate file with the ‘.css‘ file extension which is linked within the head tag of HTML document is known as the External CSS.
Why should we use External CSS ?
How to link External CSS to HTML Document :
<link rel="stylesheet" type="text/css" href="path-to-style.css">
Everyone’s journey starts as Beginners so if you have any type of confusion drop a comment we are here to reply & provide the best information regarding your comment. Thank you for reading!