सीएसएस ट्यूटोरियल

सीएसएस होम सीएसएस परिचय सीएसएस सिंटेक्स सीएसएस चयनकर्ता सीएसएस कैसे करें सीएसएस टिप्पणियाँ सीएसएस रंग सीएसएस पृष्ठभूमि सीएसएस बॉर्डर्स सीएसएस मार्जिन सीएसएस पैडिंग सीएसएस ऊंचाई/चौड़ाई सीएसएस बॉक्स मॉडल सीएसएस रूपरेखा सीएसएस पाठ सीएसएस फ़ॉन्ट्स सीएसएस प्रतीक सीएसएस लिंक सीएसएस सूचियां सीएसएस टेबल्स सीएसएस प्रदर्शन सीएसएस अधिकतम-चौड़ाई सीएसएस स्थिति सीएसएस जेड-इंडेक्स सीएसएस अतिप्रवाह सीएसएस फ्लोट सीएसएस इनलाइन-ब्लॉक सीएसएस संरेखित करें सीएसएस संयोजक सीएसएस छद्म वर्ग सीएसएस छद्म तत्व सीएसएस अस्पष्टता सीएसएस नेविगेशन बार सीएसएस ड्रॉपडाउन सीएसएस छवि गैलरी सीएसएस छवि स्प्राइट्स सीएसएस एटीआर चयनकर्ता सीएसएस फॉर्म सीएसएस काउंटर सीएसएस वेबसाइट लेआउट सीएसएस इकाइयां सीएसएस विशिष्टता सीएसएस !महत्वपूर्ण सीएसएस गणित कार्य

सीएसएस उन्नत

सीएसएस गोल कोनों सीएसएस सीमा छवियां सीएसएस पृष्ठभूमि सीएसएस रंग सीएसएस रंग कीवर्ड सीएसएस ग्रेडिएंट सीएसएस छाया सीएसएस पाठ प्रभाव सीएसएस वेब फ़ॉन्ट्स CSS 2D ट्रांसफ़ॉर्म CSS 3D ट्रांसफ़ॉर्म सीएसएस संक्रमण सीएसएस एनिमेशन सीएसएस टूलटिप्स सीएसएस शैली छवियां सीएसएस छवि प्रतिबिंब CSS ऑब्जेक्ट-फिट सीएसएस वस्तु-स्थिति सीएसएस मास्किंग सीएसएस बटन सीएसएस पेजिनेशन सीएसएस एकाधिक कॉलम सीएसएस यूजर इंटरफेस सीएसएस चर सीएसएस बॉक्स साइजिंग सीएसएस मीडिया प्रश्न सीएसएस एमक्यू उदाहरण सीएसएस फ्लेक्सबॉक्स

सीएसएस उत्तरदायी

आरडब्ल्यूडी परिचय आरडब्ल्यूडी व्यूपोर्ट आरडब्ल्यूडी ग्रिड व्यू आरडब्ल्यूडी मीडिया प्रश्न आरडब्ल्यूडी छवियां आरडब्ल्यूडी वीडियो आरडब्ल्यूडी फ्रेमवर्क आरडब्ल्यूडी टेम्पलेट्स

सीएसएस ग्रिड

ग्रिड परिचय ग्रिड कंटेनर ग्रिड आइटम

सीएसएस एसएएसएस

एसएएसएस ट्यूटोरियल

सीएसएस उदाहरण

सीएसएस टेम्पलेट्स सीएसएस उदाहरण सीएसएस प्रश्नोत्तरी सीएसएस अभ्यास सीएसएस प्रमाणपत्र

सीएसएस संदर्भ

सीएसएस संदर्भ सीएसएस चयनकर्ता सीएसएस कार्य सीएसएस संदर्भ कर्ण सीएसएस वेब सुरक्षित फ़ॉन्ट्स सीएसएस एनिमेटेबल सीएसएस इकाइयां सीएसएस पीएक्स-ईएम कनवर्टर सीएसएस रंग सीएसएस रंग मान सीएसएस डिफ़ॉल्ट मान सीएसएस ब्राउज़र समर्थन

सीएसएस स्टाइलिंग छवियां


CSS का उपयोग करके छवियों को स्टाइल करना सीखें।


गोल चित्र

border-radiusगोल चित्र बनाने के लिए संपत्ति का उपयोग करें :


पेरिस

उदाहरण

गोल छवि:

img {
  border-radius: 8px;
}
पेरिस

उदाहरण

परिक्रमा की गई छवि:

img {
  border-radius: 50%;
}

थंबनेल छवियां

borderथंबनेल इमेज बनाने के लिए प्रॉपर्टी का इस्तेमाल करें .

थंबनेल छवि:

पेरिस

उदाहरण

img {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 5px;
  width: 150px;
}

<img src="paris.jpg" alt="Paris">

लिंक के रूप में थंबनेल छवि:

उदाहरण

img {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 5px;
  width: 150px;
}

img:hover {
  box-shadow: 0 0 2px 1px rgba(0, 140, 186, 0.5);
}

<a href="paris.jpg">
  <img src="paris.jpg" alt="Paris">
</a>


उत्तरदायी छवियां

स्क्रीन के आकार में फिट होने के लिए प्रतिक्रियाशील छवियां स्वचालित रूप से समायोजित हो जाएंगी।

प्रभाव देखने के लिए ब्राउज़र विंडो का आकार बदलें:

पांच भूमि

यदि आप चाहते हैं कि किसी छवि को छोटा किया जाए, लेकिन उसके मूल आकार से बड़ा होने के लिए कभी भी स्केल न किया जाए, तो निम्नलिखित जोड़ें:

उदाहरण

img {
  max-width: 100%;
  height: auto;
}

टिप: हमारे सीएसएस आरडब्ल्यूडी ट्यूटोरियल में रिस्पॉन्सिव वेब डिज़ाइन के बारे में और पढ़ें


एक छवि केन्द्रित करें

एक छवि को केन्द्रित करने के लिए, बाएँ और दाएँ हाशिये को सेट करें autoऔर इसे एक blockतत्व में बनाएँ:

पेरिस

उदाहरण

img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 50%;
}

Polaroid छवियाँ / कार्ड

पांच भूमि

पांच भूमि

नॉर्वे

उत्तरी लाइट्स

उदाहरण

div.polaroid {
  width: 80%;
  background-color: white;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

img {width: 100%}

div.container {
  text-align: center;
  padding: 10px 20px;
}

पारदर्शी छवि

opacityसंपत्ति 0.0 - 1.0 से मान ले सकती है कम मूल्य, अधिक पारदर्शी:

जंगल

अस्पष्टता 0.2

जंगल

opacity 0.5

जंगल

opacity 1
(default)

Example

img {
  opacity: 0.5;
}

Image Text

How to position text in an image:

Example

Cingue Terre
Bottom Left
Top Left
Top Right
Bottom Right
Centered

Try it Yourself:


Image Filters

The CSS filter property adds visual effects (like blur and saturation) to an element.

Note: The filter property is not supported in Internet Explorer or Edge 12.

Example

Change the color of all images to black and white (100% gray):

img {
  filter: grayscale(100%);
}

Tip: Go to our CSS filter Reference to learn more about CSS filters.


Image Hover Overlay

Create an overlay effect on hover:

Example

Fade in text:

अवतार
Hello World

Example

Fade in a box:

अवतार
John

Example

Slide in (top):

अवतार
Hello World

Example

Slide in (bottom):

अवतार
Hello World

Example

Slide in (left):

अवतार
Hello World

Example

Slide in (right):

अवतार
Hello World

Flip an Image

Move your mouse over the image:

पेरिस

Example

img:hover {
  transform: scaleX(-1);
}

Responsive Image Gallery

CSS can be used to create image galleries. This example use media queries to re-arrange the images on different screen sizes. Resize the browser window to see the effect:

पांच भूमि
Add a description of the image here
जंगल
Add a description of the image here
उत्तरी लाइट्स
Add a description of the image here
पहाड़ों
Add a description of the image here

Example

.responsive {
  padding: 0 6px;
  float: left;
  width: 24.99999%;
}

@media only screen and (max-width: 700px){
  .responsive {
    width: 49.99999%;
    margin: 6px 0;
  }
}

@media only screen and (max-width: 500px){
  .responsive {
    width: 100%;
  }
}

Tip: Read more about Responsive Web Design in our CSS RWD Tutorial.


Image Modal (Advanced)

This is an example to demonstrate how CSS and JavaScript can work together.

First, use CSS to create a modal window (dialog box), and hide it by default.

Then, use a JavaScript to show the modal window and to display the image inside the modal, when a user clicks on the image:

नॉर्दर्न लाइट्स, नॉर्वे

Example

// Get the modal
var modal = document.getElementById('myModal');

// Get the image and insert it inside the modal - use its "alt" text as a caption
var img = document.getElementById('myImg');
var modalImg = document.getElementById("img01");
var captionText = document.getElementById("caption");
img.onclick = function(){
  modal.style.display = "block";
  modalImg.src = this.src;
  captionText.innerHTML = this.alt;
}

// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];

// When the user clicks on <span> (x), close the modal
span.onclick = function() {
  modal.style.display = "none";
}