Computer >> कंप्यूटर ट्यूटोरियल >  >> प्रोग्रामिंग >> CSS

CSS में चाइल्ड सिलेक्टर्स


चाइल्ड सिलेक्टर

CSS चाइल्ड सिलेक्टर का उपयोग किसी विशेष पैरेंट एलिमेंट के सभी चाइल्ड एलिमेंट्स को सिलेक्ट करने के लिए किया जाता है।

सिंटैक्स

element > element { /*declarations*/ }

उदाहरण 1

<!DOCTYPE html>
<html>
<head>
<style>
* { padding: 5px; }
article > div { border: dashed midnightblue; width: 45%; }
div > p { font-size: 20px; font-style: italic; box-shadow: inset 0 0 8px orange; }
</style>
</head>
<body>
<h2>Examination Detail</h2>
<article>
  <div>Exam Details</div>
  <div><p>Exam begins at 11AM.</p></div>
  <span><div> Do not bring cell phone.</div></span>
  <div> <div>Candidates should reach the center till 10:45.</div><br/>The candidates need to be bring the Admit Card. </div>
</article>
</body>
</html>

आउटपुट

CSS में चाइल्ड सिलेक्टर्स

उदाहरण 2

<!DOCTYPE html>
<html>
<head>
<style>
div { margin: auto; width: 200px; padding: 30px; background-color: moccasin; }
div > div { box-shadow: inset 0 0 8px mediumseagreen; border-top-right-radius: 50%; border-bottom-left-radius: 50%; }
</style>
</head>
<body>
<div><div></div></div>
</body>
</html>

आउटपुट

CSS में चाइल्ड सिलेक्टर्स


  1. CSS में Background Attachment CSS में Background Attachment

    CSS में background-attachment प्रॉपर्टी का उपयोग व्यूपोर्ट के सापेक्ष पेज स्क्रॉल होने पर बैकग्राउंड इमेज की स्थिति निर्दिष्ट करने के लिए किया जाता है। इसके मान scroll, fixed और local हो सकते हैं। सिंटैक्स CSS background-attachment प्रॉपर्टी का सिंटैक्स निम्नलिखित है: Selector {    backgr

  1. एडवांस CSS लेआउट फ्लेक्सबॉक्स के साथ एडवांस CSS लेआउट फ्लेक्सबॉक्स के साथ

    CSS3 फ्लेक्सबॉक्स (Flexible Box) जटिल लेआउट के लिए शक्तिशाली मोड है। कंटेनर प्रॉपर्टी: flex-direction, flex-wrap, flex-flow, justify-content, align-items, align-content। आइटम प्रॉपर्टी: flex-grow, flex-shrink, flex-basis, align-self, order। उदाहरण div { background-color: #f1f1f1; margin: 10

  1. प्योर CSS के साथ स्मूथ स्क्रॉलिंग प्योर CSS के साथ स्मूथ स्क्रॉलिंग

    परिचय CSS scroll-behavior प्रॉपर्टी हमें स्क्रॉल के व्यवहार को बदलने की अनुमति देती है। जावास्क्रिप्ट के बिना, हम एंकर लिंक्स और प्रोग्रामेटिक स्क्रॉलिंग के लिए स्मूथ स्क्रॉलिंग सक्षम कर सकते हैं। उदाहरण 1: वर्टिकल स्मूथ स्क्रॉल <!DOCTYPE html> <html> <head> <style> h