Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How many way define css in html page?

user-image
Question added by Mohammad Irfan , Certified Magento Developer , Xcite.com
Date Posted: 2013/10/08
Muhammad Majid Saleem
by Muhammad Majid Saleem , Senior PHP Developer / Project Manager , SwaamTech

You may add CSS in your website by following ways:

1st Way:

<stype type="text/css">

// Write your css style

</style>

 

2nd Way:

<link type="text/css" rel="stylesheet" href="http://css.b8cdn.com/css/all-bayt-128.css" media="all" />

 

3rd Way:

@import url("css/style.css");

irfan shaikh
by irfan shaikh , Consultant : Senior Web Designer/Front end Developer , Client : ● Impact Proximity, Dubai ● Cube Solution, Dubai ● WAC, Sharjha ● KIOEC, Kuwait ● IRIS Ltd.

There is various approach to define CSS

1. Document specific : you can define the css in head section using <style></style>

2. Link the external stylesheet : you can link the external css style by using <link rel="stylesheet" href="location of ur css file">

3. Inline style : you can define css inside the html element that will impact on the element the css dfined on it ex. : <h1 style="color: ..; font: ...";  ></h1>

If you are working on large project & you have bunch of CSS file you can import all css file into global css file using @import ex. @import reset.css & so on & then link the global css file in your html page so you don't need to link multiple css file in page.

 

 

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.