know yourselves. information, computer, 7 wonders, various.

Monday, August 29, 2016

css_part4




CSS Comments
কোডের বিস্তারিত ব্যাখ্যা দেওয়ার জন্য কোডিং এর মধ্যেই Text লিখে Comments করতে হবে। তবে এজন্য নিদিষ্ট সিম্বল ব্যবহার করতে হবে। না হলে এটি কোডিং এর অংশ হয়ে যাবে । HTML কোডিং এ কিভাবে কমান্ড লিখতে হয় তা আগেই বলা হয়েছে । এখন CSS Comments লেখা দেখাবো। কমেন্টস Source Code এর এডিট এর জন্য ব্যবহৃত হয় তবে এটি ব্রাউজারে প্রদর্শিত হয় না। CSS কমান্ড শুরু হয় /* ( স্লাস ও asterisk চিহ্ন সহযোগে) এবং শেষ হয় */ (asterisk চিহ্ন আগে ও পরে স্লাস) সহযোগে অর্থা্যৎ নিচের মত
/* This is a css Comments */
P {………..}
/* This is another css Comments */
Color:red

নিচের মত কোডিংসহ একটি ফাইল তৈরী করে style003.css নাম দিয়ে সেভ করুন।
/* This is CSS Coad */
/* This is for body color*/
body {background-color:PowderBlue;}
/* This is for Para color*/
p {color:green;font-size:20px;} 
h1 {color:red; text-align:left; font-size:16px; font-family:arial;}

নিচের মত কোডিংসহ আরও একটি HTML ফাইল তৈরী করুন। 
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<head>
<!-- This code for External CSS file-->
<link href="style002.css" rel="stylesheet"   
 type="text/css" >
<!-- This code for Internal CSS code-->
<style type="text/css">
h1 { text-align:center; font-size:30px}
</style>
</head>
<body>
This is Normal body text.
<p> This is First para</p>
<h1>Word Processor</h1>
Microsoft Word is a word processing program.
It is use to Write application, News Letter,
Writting Pad, etc.

<p> This is Second para</p>
<h1 >Spread Sheet</h1>
Microsoft Excel is a Spread Sheet program.
Its devided by Row and Column. You can make
chart using Excel.

<p> This is Third para</p>
<!-- This code for Inline CSS code-->
<h1 style="color:green;"> Database</h1>
Microsoft Access is a Spread Database
Managementprogram. It is use to create and analise table and database.
</body>
</html>
<html>
ব্রাউজার দিয়ে খুললে নিচের মত ফলাফল পাওয়া যাবে।


সি এস এস IDClass
HTML এর ডিফল্ট সিলেক্টর  ছাড়াও সিলেক্টরকে মডিফাই করে আপনি আপনার নিজস্ব সিলেক্টর তৈরী করে নিতে পারেন IDClass তৈরীর মাধ্যমে। এগুলি InternalExternal দুই ধরণের CSS ফাইলেই ব্যবহার করা যেতে পারে।

Class সিলেক্টর
Class সিলেক্টরটি HTML ফাইলের মধ্যে গ্রূপ এলিমেন্টের মধ্যে অর্থ্যাৎ একাধিক এলিমেন্টের মধ্যে বার বার ব্যবহার করা হয় । Class সিলেক্টরটি HTML এর যেকোন একটি Element (Tag) এর সাথে ব্যবহৃত হয়। তারপর Sector এর একটি নাম দিতে হয় এবং Properly:Valve দিতে হয়। আমরা জানি <p> বা <h1> এলিমেন্ট দ্বারা প্যারা বা হেডিং বোঝানো হয়। মনে করুন আপনার HTML ডকুমেন্টে বিভিন্ন ধরণের প্যারা হেডিং h1 ব্যবহার করবেন। এক্ষেত্রে প্রতিটির জন্য একটি Class তৈরী করতে হবে। Internal CSS ফাইলে করলে শুধুমাত্র বর্তমানে পেইজে এটি ব্যবহৃত হবে আর External CSS ফাইলে তৈরী করলে যে কোন পেজ বা যে কোন পেইজে অসংখ্য বার ব্যবহার করা যাবে। মনে করুন <p> এলিমেন্টের  জন্য red নামের একটি Class তৈরী করবেন এবং ফন্টের color=red size=20px হবে সেক্ষেত্রে CSS অংশে কোড হবে।
p.red {color:red; font-size : 20px}
আবার  HTML অংশে আমরা সাধারণ কোড লিখি নিচের মত
<p> This is a Paragraph </p>
কিন্তু  Class এর জন্য Class লিখে একটি সমান চিহ্ন (=) দিয়ে ডাবল কোটেশনের মধ্যে Class এর নাম দিতে হবে। যেমন
<p class = “red”> This is a Paragraph</p>
এখন red কালারের ও 20px সাইজের টেক্সট পাওয়া যাবে।
আমরা এখন p.red p.green নামের ২টি Class তৈরী ও ব্যবহার দেখাবো।

নিচের মত কোডিংসহ আরও একটি HTML ফাইল তৈরী করুন। 
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body {background-color:PowderBlue;}
p.red  {color:red;font-size:20px;}
p.green {color:green;font-size:25px;}
h1 {color:red;text-align:center;}
</style>
</head>



<body>
This is Normal body text.
<p class="red"> This is First para</p>
<h1>Word Processor</h1>
Microsoft Word is a word processing program.
It is use to Write application, News Letter,
Writting Pad, etc.

<p class="green"> This is Second para</p>
<h1>Spread Sheet</h1>
Microsoft Excel is a Spread Sheet program.
Its devided by Row and Column. You can make
chart using Excel.

<p> This is Third para</p>
<h1> Database</h1>
Microsoft Access is a Spread Database
Managementprogram. It is use to create and analise table and database.
</body>
</html>
ব্রাউজার দিয়ে খুললে নিচের মত ফলাফল পাওয়া যাবে।

Previous Post                                                                                           Next Post

  বিস্তারিত জানতে নিচের বইটি সংগরহ করে নিন।

Book Name: Mastering Microsoft  Word
Writer: Bappi Ashraf
Published By: Gyankosh Prokashani
Amount of Pages: 464
First Publish: October-2004
Last Edition: We've February-2015 edition. Future edition may be existed!
Book Price: BDT 350 (30% Discount)
 The writer of this book has told that he has written this book with the concept of "teach yourself". On the other hand, Web Design is a thing which is interesting to learn. He has also told that the book is full of fan and enjoyment so that a person can learn Web Design by himself by playing with the example projects of this book.  Book's CD Link below... 

 cd

RELATED POST LINKS BELOW ********************************************
Next_


Part- 02:  Inline Style




css_part3




External Style Sheet
অনেকগুলি পেজে Style ব্যবহারের জন্য সবচেয়ে আর্দশ উপায় হচ্ছে একটি External CSS ফাইল তৈরী করা। এখানে মোট ২টি ফাইল নিয়ে কাজ করতে হবে। External CSS ফাইলটি তৈরী করে একই ড্রাইভে একটি নাম দিয়ে রাখতে হবে । উল্লেখ্য কোডিং লিখে .CSS নামের Extension দিলেই আলাদা CSS ফাইল তৈরী হবে। একই উপায়ে এডিটরে কোডিং লিখতে হবে। ফাইলের নাম যেমন মনে করি mystyle.css দিতে হবে। কাজেই প্রথমে একটি CSS ফাইল তৈরী করতে হবে । পরে আরেকটি HTML ফাইল তৈরী করে তার মধ্যে <head> সেকশনে External CSS ফাইলটি Link এর মাধ্যমে Call করতে হবে এবং বাকী HTML কোড শেষ করতে হবে। ফাইলটি .html হিসাবে সেভ করে ব্রাউজারে দেখতে হবে, ব্যাস। CSS ফাইল Call করার জন্য <link> ট্যাগ ব্যবহার করতে হবে <head> সেকশনে। কোডিং হবে নিম্নরুপ(HTML) ফাইলে -
<head> <link rel = “stylesheet”  type =“text/css”  href = ”cssfilename.css”>
</head>
যেমন CSS ফাইলটির নাম যদি হয়ে mystyle.css তবে কোডিং হবে
<head> <link rel = “stylesheet” type = “text/css” href =“mystyle.css”>
</head>
আমাদের আগের ফাইলগুলি এখন আমরা External CSS ফাইল দ্বারা মডিফাই করবো।
Program_Style001
নিচের মত কোডিংসহ একটি ফাইল তৈরী করে style001.css নাম দিয়ে সেভ করুন।
body {background-color:PowderBlue;}
p {color:green;font-size:20px;}
h1 {color:red;text-align:center;}
h2 {color:blue;text-align:left;}>

Editor এ নিচের মত দেখাবেঃ




Program_CSS004
নিচের মত কোডিংসহ আরও একটি HTML ফাইল তৈরী করুন। 
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css"  
 href="style001.css">
</head>
<body>
This is Normal body text.

<p> This is First para</p>
<h1>Word Processor</h1>
Microsoft Word is a word processing program.It is use to Write application, News Letter, Writting Pad, etc.

<p> This is Second para</p>
<h1>Spread Sheet</h1>
Microsoft Excel is a Spread Sheet program.Its devided by Row and Column. You can make chart using Excel.

<p> This is Third para</p>
<h1> Database</h1>
Microsoft Access is a Spread Database Management program. It is use to create and analise table and database.
</body>
</html>

ব্রাউজার দিয়ে খুললে নিচের মত ফলাফল পাওয়া যাবে।


Multiple CSS ( Internal+External+Inline)
অনেক সময় একই সিলেক্টরের জন্য ভিন্ন ভিন্ন Style Sheet ব্যবহার করা হয়। মনে করুন কোন External Style Sheet h1 এর জন্য বিভিন্ন ভ্যালু দেওয়া আছে। আবার h1 এর জন্য Internal ভাবে নতুন ভ্যালু দেওয়া হলো - এক্ষেত্রে প্রথমে Internal CSS এর Value গ্রহন করে পরে বাকী ভ্যালু External CSS থেকে গ্রহন করবে। যদি Inline CSS দেওয়া থাকে তবে সেটির সর্বোচ্চ প্রাধান্য দেওয়া হবে। এক্ষেত্রে কমন ভ্যালু বাদে বর্ধিত ভ্যালু নেওয়া হবে External CSS থেকে। নিচের উদাহরণে External Style sheet (Style 002.css) তে h1 ট্যাগে {color:red; text align:left: font-size:16px font family:arial} নেওয়া হয়েছে। অপর দিকে Internal Style sheet { text align: center: font size:30px} নেওয়া হয়েছে।

সেজন্য H1 ট্যাগে প্রথমে Internal Style sheet থেকে text align: center: font size:30px  এই ভ্যালু এবং External Style sheet sheet থেকে color:red font family:arial বাস্তবয়িত হয়েছে। অপর দিকে Inline Style h1{ Style=”color:green} ব্যবহার করার কারণে। এখান থেকে color:green Internal Style sheet (Style 002.css) থেকে { text align: center: font size:30px} এবং শেষে External Style sheet থেকে চতুর্থ বাকী অংশ font family:arial বাস্তবয়িত হয়েছে ।


style002.css নাম দিয়ে সেভ করুন।
body {background-color:PowderBlue;}
p {color:green;font-size:20px;}
h1{color:red;text-align:left;font-size:16px;
font-family:arial;}

HTML code
<!DOCTYPE html>
<html>
<head>
<link href="style002.css" rel="stylesheet"
type="text/css">
<style type="text/css">
h1 { text-align:center; font-size:30px}
</style>
</head>
<body>
This is Normal body text.
<p> This is First para</p>
<h1>Word Processor</h1>
Microsoft Word is a word processing program.
It is use to Write application, News Letter,
Writting Pad, etc.

<p> This is Second para</p>
<h1 >Spread Sheet</h1>
Microsoft Excel is a Spread Sheet program.
Its devided by Row and Column. You can make
chart using Excel.

<p> This is Third para</p>
<h1 style="color:green;"> Database</h1>
Microsoft Access is a Spread Database
Managementprogram. It is use to create and analise table and database.
</body>
</html>
ব্রাউজার দিয়ে খুললে নিচের মত ফলাফল পাওয়া যাবে।

Previous Post                                                                                           Next Post

  বিস্তারিত জানতে নিচের বইটি সংগরহ করে নিন।

Book Name: Mastering Microsoft  Word
Writer: Bappi Ashraf
Published By: Gyankosh Prokashani
Amount of Pages: 464
First Publish: October-2004
Last Edition: We've February-2015 edition. Future edition may be existed!
Book Price: BDT 350 (30% Discount)
 The writer of this book has told that he has written this book with the concept of "teach yourself". On the other hand, Web Design is a thing which is interesting to learn. He has also told that the book is full of fan and enjoyment so that a person can learn Web Design by himself by playing with the example projects of this book.  Book's CD Link below... 

 cd

RELATED POST LINKS BELOW ********************************************
Next_


Part- 02:  Inline Style