css_part11
Background ইমেজকে fixed করা
সাধারনত যখন ইমেজকে repeat horizontally বা no-repeat করা হয় এবং নিচে অনেক
টেক্সট বা অবজেষ্ট থাকে, তখন নিচের দিকে স্ত্রুল করতে থাকলে উপরের ব্যকগ্রাউন্ড
ইমেজও স্ত্রুল হয়। এটি বন্ধ করার জন্য অর্থ্যাৎ টেক্সট বা অবজেক্ট ক্রল হবে কিন্তু
ব্যাকগ্রাউন্ড ইমেজ নড়বে না, এজন্য background-attachment প্রোপার্টিজ এর সাথে Value দিতে হবে fixed। নিচের মত
প্রোগ্রাম তৈরী করে দেখুন।
নিচের মত কোডিংসহ আরও একটি 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;
background-attachment:fixed;
}
</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> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
This
is Normal Text.
</body>
</html>
ব্রাউজার দিয়ে খুললে নিচের মত ফলাফল পাওয়া যাবে।
Brackground ইমেজের পজিশন নির্নয়
ডিফল্ট হিসাবে ইমেজের পজিশন থাকে উপরে (Top) এবং বামদিকে (leff). background-position প্রোপার্টিজ দ্বারা value কে left, right, top, bottom ইত্যাদির মাধ্যমে ইমেজের পজিশন নির্নয় করে দেওয়া
যায়। এক্ষেত্রে ইমেজ ডানদিকে নিলে right margin ঠিক করে দিতে হবে। নিচের মত
প্রোগ্রাম তৈরী করে দেখুন
নিচের মত কোডিংসহ আরও একটি 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;
background-attachment:fixed;
background-position:right
bottom;
margin-right:100px;
}
</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> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
This
is Normal Text.
</body>
</html>
ব্রাউজার দিয়ে খুললে নিচের মত ফলাফল পাওয়া যাবে।
Background-Properties এর ভ্যালু গুলি হচ্ছে left top, left center, left bottom, right
top, right center, right bottom, center top, center center, center bottom, x%,
y%( ডিফল্ট) xpos ypos (px) inherit.
পারসেন্ট (%) ব্যবহারে
পজিশন নির্ণয়
নিচের মত কোডিংসহ আরও একটি 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;
background-attachment:fixed;
background-position:
30% 50%; <!left top>
margin-right:100px;
}
</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> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
This
is Normal Text.
</body>
</html>
ব্রাউজার দিয়ে খুললে নিচের মত ফলাফল পাওয়া যাবে।
পিক্সেল (px) ব্যবহারে
পজিশন নির্ণয়
নিচের মত কোডিংসহ আরও একটি 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;
background-attachment:fixed;
background-position:
50px 100px; <!left top>
margin-right:100px;
}
</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> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
<p>This
is a paragraph with CSS background-image </p> <br />
This
is Normal Text.
</body>
</html>
ব্রাউজার দিয়ে খুললে নিচের মত ফলাফল পাওয়া যাবে।
বিস্তারিত জানতে নিচের বইটি সংগরহ করে নিন।
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...
Next_