ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

How many way define css in html page?

user-image
تم إضافة السؤال من قبل Mohammad Irfan , Certified Magento Developer , Xcite.com
تاريخ النشر: 2013/10/08
Muhammad Majid Saleem
من قبل 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
من قبل 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.

 

 

المزيد من الأسئلة المماثلة

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟