Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

How many way define css in html page?

user-image
Question ajoutée par Mohammad Irfan , Certified Magento Developer , Xcite.com
Date de publication: 2013/10/08
Muhammad Majid Saleem
par 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
par 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

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?