কম্পিউটার টিউটোরিয়াল

CSS ব্যবহার করে টেক্সট কালার সেট করা


CSS color প্রোপার্টি একটি এলিমেন্টের টেক্সট কালার সেট করতে ব্যবহৃত হয়।

সিনট্যাক্স

CSS color প্রোপার্টির সিনট্যাক্স নিম্নরূপ:

Selector {    color: /*value*/ }

উদাহরণ

নিচের উদাহরণগুলো CSS color প্রোপার্টি ইলাস্ট্রেট করে:

<!DOCTYPE html> <html lang="en"> <head> <style> div {    height: 100px;    width: 200px;    margin: 10px;    display: flex;    float: left;    font-size: 1.4em;    word-spacing: 30px;    line-height: 4.5em;    border: thin solid blue;    border-radius: 40%;    text-align: center;    color: rebeccapurple; } div + div{    background-color: beige;    color: red;    text-align: justify;    text-decoration: line-through; } </style> </head> <body> <div>One Two</div> <div>Three </div> </body> </html>

আউটপুট

এটি নিম্নলিখিত আউটপুট দেয়:

CSS ব্যবহার করে টেক্সট কালার সেট করা

আরেকটি উদাহরণ

<!DOCTYPE html> <html lang="en"> <head> <style> p {    margin: 10px;    display: flex;    float: left;    border: 3px groove green;    text-align: center;    color: rebeccapurple; } span{    background-color: beige;    color: red;    text-decoration: underline; } </style> </head> <body> <h2>What is Tableau?</h2> <p>Tableau is a Business Intelligence tool for visually analyzing the data. <span>Users can create and distribute an interactive and shareable dashboard, which depict the trends, variations, and density of the data in the form of graphs and charts. </span> Tableau can connect to files, relational and Big Data sources to acquire and process data.</p> </body> </html>

আউটপুট

এটি নিম্নলিখিত আউটপুট দেয়:

CSS ব্যবহার করে টেক্সট কালার সেট করা

  1. CSS দিয়ে টেক্সট ইন্ডেন্টেশন (Text Indentation) কাজ করা

  2. CSS text-transform দিয়ে টেক্সট ক্যাপিটালাইজেশন নিয়ন্ত্রণ

  3. CSS-এ কালার প্রপার্টি সেট করা: টেক্সট, বর্ডার, ব্যাকগ্রাউন্ড

  4. CSS color প্রপার্টি দিয়ে এলিমেন্টের টেক্সট রঙ পরিবর্তন