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

Thursday, September 1, 2016

css_part10




 CSS দ্বারা Background তৈরী
একটি ওয়েবসাইটের ব্যাকগ্রাউন্ড ইফেক্ট নির্ধারন করা হয় Background প্রোপার্টিজ দ্বারা। ব্যবহৃত background প্রোপার্টিজগুলো হচ্ছে background-color, background-image, background-repeat, background-attachment, background-position নিচে আমরা এগুলির বিস্তারিত বিবরনসহ ব্যবহার শিখবো।
Background color এর ব্যবহার
বলাই বাহুল্য যে background-color প্রোপার্টিজ দ্বারা পেজ, হেডিং, প্যারা বা ডিভিশনের ব্যাকগ্রাউন্ড কালার নির্ধারন করা হয় । এটি {body} সেকশনের অবজেক্টের উপর প্রতিফলিত হয়। CSS কালারকে নির্ধারন করা হয়- CSS এর color অপশনগুলি দ্বারা যেমন
                                    HEX Value যেমন # ff0000
                                    RGB Value যেমন rgb (255,0,255)
                                    RGBA Value যেমন rgba (255,0,255,1)
                                    HSL Value যেমন hsl (120,75%,75%)
                                    HSLA Value যেমন^ hsla (120,75%,75%,.5)
                                    Color name যেমন red বা green বা navy
চলুন body, paragraph, headingdavision ট্যাগের সাথে background-color প্রোপার্টিজ ব্যবহার করে একটি প্রোগ্রাম তৈরী করি।
নিচের মত কোডিংসহ একটি ফাইল তৈরী করে style021.css নাম দিয়ে সেভ করুন।
/* This is CSS Coad for background-color*/
h1
{
background-color:#6495ed;
}
p
{
background-color:#e0ffff;
}
div
{
background-color:#b0c4de;
}

body
{
background-color:yellow;
}


নিচের মত কোডিংসহ আরও একটি HTML ফাইল তৈরী করুন। 
<!DOCTYPE html>
<head>
<title>CSS background properties</title>
<link href="style021.css" rel="stylesheet" type="text/css" />
</head>

<body>
<h1>This is heading with CSS background-color</h1>
<div>
This is a div element with CSS background-color </div>
<p>This is a paragraph with CSS background-color</p>
This is Normal Text.
</body>
</html>

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


আশাকরি stylesheet এর ব্যপারটি আমাদের কাছে পরীষ্কার। কাজেই ২টি program এর বদলে এখন থেকে html. ফাইলে Internal stylesheet ব্যবহার করে ১টি program দিয়ে ব্যখ্যা শেষ করব। শুধুমাত্র professional page (Special Project)এর ক্ষেত্রে ২টি program ব্যবহার করব।
Background Image এর ব্যবহার
সাধারনত Background Image হিসাবে gif, jpg বা png ইমেজকে ব্যবহার করা হয়। ব্যাকগ্রাউন্ড হিসাবে যে  ইমেজটি ব্যবহার করা হয় সেটি হরাইজেন্টালি ও ভার্টিক্যালি রিপিট হতে থাকে। কাজেই সমস্ত ওয়েব পেজের ব্যকগ্রাউন্ড হিসাবে ব্যবহৃত হয়। এক্ষেত্রে একটি বিষয় মনে রাখবেন ফরগ্রাউন্ড যদি হালকা কালারের টেক্সট ও অবজেষ্ট ব্যবহার করেন তবে ব্যাকগ্রাউন্ট ডিপ কালার করবেন। অনথ্যায় বিপরীত কালার ব্যবহার করবেন। চলুন নিচের মত program তৈরী করে ব্যাপারটি বুঝে নেওয়া যাক।
নিচের মত কোডিংসহ আরও একটি HTML ফাইল তৈরী করুন। 
<!DOCTYPE html>
<!DOCTYPE html>
<head>
<title>CSS background properties</title>
<style>
h1 {background-color:#6495ed;}
p{background-color:#e0ffff;}
div{background-color:#b0c4de;}
body {background-image:url('My_Logo.jpg');}
</style>
</head>
<body>
<h1>Heading with CSS background-image</h1>
<div>
This is a div element with CSS background-image </div>
<p>This is a paragraph with CSS background-image</p>
This is Normal Text.
</body></html>
<html>
ব্রাউজার দিয়ে খুললে নিচের মত ফলাফল পাওয়া যাবে।


Background ইমেজকে হরাইজেন্টালি/ভারর্টিক্যালি/no-repeat করা
Background ইমেজকে হরাইজেন্টলি ও ভারর্টিক্যাল রিপিট হতে থাকে। কিন্তু background-repeat প্রোপার্টিজ দ্বারা এটি নিয়ন্ত্রন করা যায়। repeat-x ভ্যালু দ্বারা হরাইজেন্টালি ও repeat-y দ্বারা ভার্টিক্যাল রিপিট করা যায়। আবার no-repeat দ্বারা রিপিট না করে শুধুমাত্র একবার প্রদর্শন করা যায়। নিচের মত ৩টি প্রোগ্রাম তৈরী করে দেখুন।
নিচের মত কোডিংসহ আরও একটি HTML ফাইল তৈরী করুন। 
<!DOCTYPE html>
<head>
<title>CSS background properties</title>
<style>
h1 {background-color:#6495ed;}
p{background-color:#e0ffff;}
div{background-color:#b0c4de;}
body {
background-image:url('My_Logo.jpg');
background-repeat:repeat-x;
}
</style>
</head>
<body>
<h1>Heading with CSS background-image</h1>
<div>
This is a div element with CSS background-image </div>
<p>This is a paragraph with CSS background-image</p>
This is Normal Text.
</body>
</html>
ব্রাউজার দিয়ে খুললে নিচের মত ফলাফল পাওয়া যাবে।


নিচের মত কোডিংসহ আরও একটি HTML ফাইল তৈরী করুন। 
<!DOCTYPE html>
<head>
<title>CSS background properties</title>
<style>
h1 {background-color:#6495ed;}
p{background-color:#e0ffff;}
div{background-color:#b0c4de;}
body {
background-image:url('My_Logo.jpg');
background-repeat:repeat-y;
}
</style>
</head>
<body>
<h1>Heading with CSS background-image</h1>
<div>
This is a div element with CSS background-image </div>
<p>This is a paragraph with CSS background-image</p>
This is Normal Text.
</body>
</html>
ব্রাউজার দিয়ে খুললে নিচের মত ফলাফল পাওয়া যাবে।



নিচের মত কোডিংসহ আরও একটি HTML ফাইল তৈরী করুন। 
<!DOCTYPE html>
<!DOCTYPE html>
<head>
<title>CSS background properties</title>
<style>
h1 {background-color:#6495ed;}
p{background-color:#e0ffff;}
div{background-color:#b0c4de;}
body {
background-image:url('My_Logo.jpg');
background-repeat:no-repeat;
}
</style>
</head>
<body>
<h1>Heading with CSS background-image</h1>
<div>
This is a div element with CSS background-image </div>
<p>This is a paragraph with CSS background-image</p>
This is Normal Text.
</body>
</html>
</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_part9




Professional Project
একটি ওয়েব Template বা Site বানানোর জন্য আমরা যথেষ্ট পরিমানে HTML CSS কোড শিখে ফেলেছি। এগুলি ব্যবহার করে ধীরে ধীরে একটি ওয়েব সাইট  Template তৈরী করবো। এটি মোট কয়েকটি ধাপে করা হবে। পরে আমরা বিভিন্ন কোডিং শেখার সাথে সাথে সাইটির আরও ডেভেলপ করবো। একটি নতুন ফোল্ডার তৈরী করে নিচের মত কোড লিখুন।
 (Special Project)
নিচের মত কোডিংসহ একটি ফাইল তৈরী করে style018(mystyle_01).css নাম দিয়ে সেভ করুন
body{background:#CCCCCC;}
#wrapper
#head
#content
#footer
 (Special Project)
নিচের মত কোডিংসহ আরও একটি HTML ফাইল তৈরী করুন। 
<!DOCTYPE html>
<html>
<head><title>web example</title>
<link href="Style018(mystyle_01).css" rel="stylesheet" type="text/css" /></head>
<body>
<div id="wrapper">
<div id="head"> This is Head</div>
<div id="content">This is Content </div>
<div id="footer">This is Footer</div></div>
</body></html>
ব্রাউজার দিয়ে খুললে নিচের মত ফলাফল পাওয়া যাবে।



উপরের ফাইলে শুধুমাত্র ID ডিক্লেয়ার ও HTML ফাইলে ID Call করা ও Sample Text দেওয়া হয়েছে। এখন আমরা Head, Content, Footer এর জন্য জায়গা নির্ধারণ করবো এবং এই তিনটি অবজেক্ট (<div>)কে Wrapper নামে একটি বড় ID (<div>) এর মধ্যে রাখবো। Wrapper হচ্ছে সমস্ত Web page এর Width Hight এর মধ্যে Head, Content, Footer রাখবো। পরে এগুলিতেও অবজেক্ট যোগ করা হবে।
আপাতত নিচের ফরম্যাটটি দেখুন



উপরের ছকটিকে আমরা 2px পরিমানে এবং # ff0000(red) কালারের Solid Border যোগ করবো। কোডিং হবে
Border: 2px Solid # FF0000
এবং Width Hight এর জন্য কোডিং হবে
Width : 850 px
Hight  : 400 px  ইত্যাদি
চলুন বাক্স বানাই
 (Special Project)
নিচের মত কোডিংসহ একটি ফাইল তৈরী করে style019(mystyle_02).css নাম দিয়ে সেভ করুন।
/* CSS Document */
body{background:#CCCCCC; }
#wrapper{width:850px; height:900px;
         border:2px solid #a1a1a1;}
#head{background-color:PowderBlue; width:850px;
          height:400px; border:2px solid #ff0000;}
#content{background-color:#00ff00; width:850px;
          height:400px; border:2px solid #ff0000;}
#footer{background-color:PowderBlue; width:850px;
          height:100px; border:2px solid #ff0000;}

(Special Project)
নিচের মত কোডিংসহ আরও একটি HTML ফাইল তৈরী করুন। 
<!DOCTYPE html>
<html>
<head>
<title>web example</title>
<link href="Style019(mystyle_02).css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="wrapper">
<div id="head"> This is Head</div>
<div id="content"> This is Content </div>
<div id="footer">This is Footer </div> </div>
</body> </html>
ব্রাউজার দিয়ে খুললে নিচের মত ফলাফল পাওয়া যাবে।


এখন আমরা head অংশকে ৩ ভাগে ভাগে করবো। প্রথমে W-300px, h-100px  এর একটি Logo র জন্য জায়গা রাখবো্ যেখানে Text ও ইমেজ সংযোজন করা হবে এবং left থেকে শুরু করবো। এরপর একটি মেনুর জন্য Right দিকে W-400px, h-20px পরিমান জায়গা রাখবে  Top Margin হবে 100px এরপর একটি ইমেজের জন্য জায়গা রাখবো W- 850px, h-300px এবং Top Margin হবে 100px Content কেও ৩ ভাগে ভাগ করে content-left width 250px, hight 400, content-right width 250px, hight 400 এবং content-mid width 338px, hight 400px করবো। Footer আগের মতই থাকবে। ( এখানে উল্লেখ্য যে Border এর জন্য মাপ একটু ছোট/বড় হবে কারণ ৪দিকে 2px করে border রয়েছে ) চলুন তৈরী করা যাক
Program_Style020 (Special Project)
নিচের মত কোডিংসহ একটি ফাইল তৈরী করে Style020(mystyle_03).css নাম দিয়ে সেভ করুন।
/* CSS Document */
body{background:#CCCCCC; }
#wrapper{width:850px;
          height:900px;
          border:2px solid #a1a1a1;}
#head{background-color:PowderBlue;
          width:850px;
          height:400px;
          border:2px solid #ff0000;}       
#logo{width:300px;
          height:100px;
          font-size:24px;
          float:left;
          border:2px solid #0000ff;}
#menu{width:450px;
          height:20px;
          float:right;
          font-size:24px;
          margin-top:100px;
          border:2px solid #0000ff;}
#image{width:850px;
          height:300px;
          font-size:24px;
          border:2px solid #ff0000;
          border:2px solid #0000ff;
          margin-top:100px;}
#content{background-color:#00ff00;
          width:850px;
          height:400px;
          border:2px solid #ff0000;}
#content_left{width:250px;
          height:400px;
          float:left;
          font-size:24px;
          border:2px solid #ff0000;}
#content_mid{width:338px;
          height:400px;
          float:left;
          font-size:24px;
          border:2px solid #ff0000;}

#content_right{width:250px;
          height:400px;
          float:right;
          font-size:24px;
          border:2px solid #ff0000;}
#footer{background-color:PowderBlue;
          width:850px;
          height:100px;
          font-size:50px;
          border:2px solid #ff0000;}

 (MyIndex_03 -Special Project)
নিচের মত কোডিংসহ আরও একটি HTML ফাইল তৈরী করুন। 
<!DOCTYPE html>
<html>
<head>
<title>web example</title>
<link href="Style020(mystyle_03).css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<div id="head"> This is Head
<div id="logo"> Image and Logo text here </div>
<div id="menu">Menu Menu Menu </div>
<div id="image">Image</div></div>
<div id="content">
<div id="content_left"> Left Bar. Look! here is some link. </div>
<div id="content_mid">About Nova Computer, Main content here </div>
<div id="content_right">Right Bar. Look! here is some link. </div> </div>
<div id="footer">This is Footer </div>
</div>
</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