Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tie_insta_widget has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/plugins/instanow/instanow-admin.php on line 197

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; taqyeem_review_widget has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/plugins/taqyeem/taqyeem-widgets.php on line 7

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; taqyeem_get_reviews has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/plugins/taqyeem/taqyeem-widgets.php on line 61

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; taqyeem_types_get_reviews has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/plugins/taqyeem/taqyeem-widgets.php on line 161

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ads125_widget has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-ads.php on line 8

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ads120_90_widget has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-ads.php on line 129

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ads120_60_widget has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-ads.php on line 250

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ads120_600_widget has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-ads.php on line 372

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ads120_240_widget has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-ads.php on line 493

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ads160_600_widget has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-ads.php on line 613

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ads300_600_widget has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-ads.php on line 721

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ads250_250_widget has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-ads.php on line 830

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ads300_100_widget has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-ads.php on line 942

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ads300_250_widget has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-ads.php on line 1054

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tie_video_widget has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-video.php on line 7

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tie_posts_list has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-posts.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tie_login_widget has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-login.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tie_google_widget has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-google.php on line 7

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tie_widget_tabs has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-tabbed.php on line 7

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tie_flickr_photos has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-flickr.php on line 7

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tie_author_widget has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-author.php on line 7

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; author_post_widget has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-author.php on line 68

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tie_social_widget has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-social.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tie_search has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-search.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tie_slider has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-slider.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; TIE_WeatherWidget has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-weather.php on line 220

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tie_youtube_widget has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-youtube.php on line 7

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tie_Latest_Tweets has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-twitter.php on line 7

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tie_timeline_widget has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-timeline.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tie_facebook_widget has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-facebook.php on line 7

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tie_categort_posts has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-category.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tie_news_pic has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-news-pic.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tie_text_html has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-text-html.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tie_feedburner_widget has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-feedburner.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tie_soundcloud has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-soundcloud.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tie_author_custom has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-author-custom.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tie_Author_Bio has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-custom-author.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tie_authors_posts has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-authors-posts.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tie_comments_avatar has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/widgets/widget-comments-avatar.php on line 6

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; arqam_lite_counter_widget has a deprecated constructor in /home1/cjsmpham/_addon/priyolekha.com/wp-content/themes/sahifa/framework/functions/arqam-lite.php on line 736
ওয়েব ডিজাইন CSS Part-3(Inline CSS, Internal CSS, External CSS) – Creative IT Blog
Notice: Trying to access array offset on value of type bool in /home1/cjsmpham/_addon/priyolekha.com/wp-content/plugins/taqyeem/taqyeem.php on line 611

Notice: Trying to access array offset on value of type bool in /home1/cjsmpham/_addon/priyolekha.com/wp-content/plugins/taqyeem/taqyeem.php on line 611

Notice: Trying to access array offset on value of type bool in /home1/cjsmpham/_addon/priyolekha.com/wp-content/plugins/taqyeem/taqyeem.php on line 611

Notice: Trying to access array offset on value of type bool in /home1/cjsmpham/_addon/priyolekha.com/wp-content/plugins/taqyeem/taqyeem.php on line 611

Notice: Trying to access array offset on value of type bool in /home1/cjsmpham/_addon/priyolekha.com/wp-content/plugins/taqyeem/taqyeem.php on line 611

Notice: Trying to access array offset on value of type bool in /home1/cjsmpham/_addon/priyolekha.com/wp-content/plugins/taqyeem/taqyeem.php on line 611
Home / বিজ্ঞান ও প্রযুক্তি / ওয়েব ডিজাইন CSS Part-3(Inline CSS, Internal CSS, External CSS)

ওয়েব ডিজাইন CSS Part-3(Inline CSS, Internal CSS, External CSS)

Types of  CSS:

HTML এর সাথে CSS  যুক্ত করার বিষয়টি খুবই গুরুত্বপূর্ণ। HTML  এর সাথে CSS যুক্ত করার জন্য তিনটি পদ্ধতি রয়েছে। যথা-

  1. Inline CSS
  2. Internal CSS
  3. External CSS

1.Inline CSS

HTML এলিমেন্টে style এট্রিবিউট দিয়ে CSS রুল লেখা যায় এটাই ইনলাইন CSS । খুব প্রয়োজন না হলে inline css লেখা উচিৎ নয়। মুলত সবসময়  External css  ব্যবহার করা উচিৎ। যেহেতু এলিমেন্টের ভিতরেই css লেখা হয় তাই inline  css এর জন্য সিলেক্টর প্রয়োজন হয়না। যেমন-

<h2 style=”background-color: #555; color: #fff;”> inline css h2 code </h2>
<p style=”color:#ccc; text-align:justify;”> inline css  code </p>

এখানে একটা পার্থক্য হচ্ছে কোন সিলেক্টর দিতে হয়না আর curly braces ও নেই।
সেমিকোলন (;) দিয়ে প্রতিটি লাইন আলাদা রাখতে হবে । এভাবে যত ইচ্ছা প্রোপার্টি লিখতে পারেন।

2. Internal css:

এ পদ্ধতিতে <head>………….</head> এর মধ্যে <style>..</style> বা স্টাইল ট্যাগ ব্যাবহার করা হয়। এবং <style>….</style> এর মধ্যেই CSS এর জন্য প্রয়োজনীয় Selector  এবং Declaration সমূহ রাখা হয়।

যেকোন HTML ডকুমেন্টে <head></head> এর ভিতর style ট্যাগ ব্যবহার করে ইন্টারনাল CSS লেখা হয়। যেমন-
<!DOCTYPE html>
<html>
<head>
<style>

h1{

color: #f00;
background: yellow;
text-align: center;

}

</style>
</head>
<body>
<h1> Internal css demo heading</h1>
<p> Internal css demo content here </p>
</body>
</html>

CSS  কিভাবে লিখতে হয় সেটা এখানে খুব ভালভাবে দেখে নিন। এভাবেই CSS লেখা হয় অর্থ্যাৎ প্রথমে সিলেক্টর এরপর দ্বিতীয় বন্ধনীর (curly braces ) মধ্যে একটা একটা করে প্রেপার্টি এবং তার মান দেয়া হয়। প্রোপার্টি এবং এর মানের মাঝে কোলন (:)  চিহ্ন দিতে হবে এবং মানের শেষে সেমিকোলন (;) দিতে হবে তা নাহলে কোড কাজ করবেনা।
ইন্টারনাল সিএসএস <head></head> ট্যাগের ভিতর লেখাই নিয়ম তবে ডকুমেন্টের অন্য কোথাও দিলেও কাজ করবে (সাধারনত body এলিমেন্টর ভিতরও দেয়া যায়)।
প্রোপার্টি গুলির মান নির্দিষ্ট থাকে তাই শুধু সেগুলিই ব্যবহার করতে পারবেন। যেমন text-align প্রেপার্টি টির মান ৫ ধরনের হতে পারে “left”, “right”, “center”, “justify”, “inherit

3. External css

Internal বা Inline CSS  খুব প্রয়োজন ছাড়া লেখা হয়না কারন এতে HTML ফাইল অনেক বড় হয়ে যায়। তাই সব CSS একসাথে করে একটা ফাইলে রেখে সেটা .css এক্সটেনশন নাম দিয়ে (যেমন style.css) সেভ করে HTML ফাইলে সংযুক্ত করে দিলেই হয়ে যায়। এটার নামই হচ্ছে এক্সটার্নাল সিএসএস। HTML  এ link নামে একটা ট্যাগ আছে এটা দিয়েই সংযোগ দেয়া যায়। একটা উদাহরন-

<!DOCTYPE html>
<html>
<head>
<link href=”style.css” rel=”stylesheet” type=”text/css”/>
</head>
<body>
<h1> Internal css demo heading</h1>
<p> Internal css demo content here </p>
</body>
</html>

এখানে দেখুন Internal CSS  এর জায়গায় link ট্যাগ দিয়ে কিভাবে style.css ফাইলটি যোগ করেছি। href হচ্ছে এট্রিবিউট, এখানে ফাইলটির উৎস বা কোথায় আছে সেটা দেখিয়ে দিতে হয়। rel এট্রিবিউটট দিয়ে HTML ডকুমেন্ট টি এবং CSS ফাইল এর মধ্যে সম্পর্ক টা কি  (stylesheet)  সেটা ব্রাউজারকে বুঝানো হয়, এটা দিতে হবে। আর type এট্রিবিউট এর মান text/css দিয়ে বুঝানো হচ্ছে এটা একটা CSS ফাইল।এবার এই ফাইলটি index.html নামে সেভ করুন।

h1{

color: #555;
background: #f1f1f1;
text-align: center;

}

আর এই কোড টুকু  style.css file  এ লিখুন তাহলে দেকবেন কাজ করছে ।
এরপর index.html browser রান করিয়ে দেখুন সব CSS  গুলি সেখানে কাজ করছে ।
প্রফেশনালি সবাই External CSS  ব্যবহার করে কেননা একটা HTML ফাইলের জন্য হাজার হাজার লাইন পর্যন্ত CSS  লিখতে হয়। ফলে HTML এবং CSS ফাইল আলাদা করাটা জরুরি হয়ে পরে এবং পরবর্তীতে কোড মেইনটিনেন্স এর কাজ অত্যন্ত সহজ হয়ে যায়।

About Md. Sajal

Check Also

সূর্যের মৃত্যু ঘটলে কেমন হবে ভাবুন তো!

বিজ্ঞানীরা বলেন যে একটা সময় সকল নক্ষত্রের মৃত্যু ঘটবে। আসলে নক্ষত্রের মৃত্যুটা ঠিক কেমন হবে? …

Leave a Reply

Your email address will not be published. Required fields are marked *