حالت آفلاین — محتوا از حافظهٔ کش نمایش داده می‌شود

انتخاب عنصر داخل یک عنصر دیگه

تمرین آسان 911 visibility link download flag

کد css بنویسید که تمام span هایی که بصورت مستقیم داخل div هستند رو انتخاب کند و رنگ متن آنها را به قرمز تغییر دهد

👨‍💻 12 ساعت قبل کاربر ناشناس این تمرین رو مشاهده کرد

reply 10

visibility
<!DOCTYPE html>
<html dir="rtl">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>span تگ </title>
    <style>
        div > span {
            color: red; }
    </style>
</head>
<body>
    <div><span>This text will be red.</span>
        <div>         
         </div><span>This text will also be red.</span>
        </div>
         <span>This text will not be red.</span>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Training</title>
  <style>
   div > span{
    color: red;
    background-color: blanchedalmond;
    display: inline-block;
    width: 220px;
    padding: 10px;
    margin-top: 10px;
    border-radius: 20px;
    text-shadow: 0 0 8px black;
    box-shadow: 0 0 20px black;
   }
   div > span:hover{
    background-color: rgb(219, 211, 211);
    color: white;
   }
  </style>
</head>
<body>

  <div>
    mama mia...<span>heyyyy</span><br>
    <span>hey yooooo</span>
    <section>
      <p>hi babe!</p>
      <span>this is the end.</span>
    </section>
    <span>hold your breath and count to 10.</span>
    <p>from Adele</p>
  </div>

</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>انتخاب عنصر داخل یک عنصر دیگه</title>
    <style>
        div > span{
            color: red;
            font-size: 20px;
        }
    </style>
</head>
<body>
    <div>
        <span>a</span>
        <div>
            <span>b</span>
        </div>
        <span>c</span>
    </div>
</body>
</html>

<!DOCTYPE html>
<html lang="en";>
<head>
<meta charset="UTF-8">
<meta name="viewport " content="width=device-width,intial-scale=1.0">
<title> box</title>
<style>
div>span{
    background-color: red;
}
div{
    background-color: aqua;
}
</style> 
</head>
<body>
<div >
<span>ghjkl</span>
</div>
<div>
    cfghjkl</div>
</body>
</html>
<!DOCTYPE html>
<html style="font-size: 80px;">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>MOHAMMAD ALI MESBAH</title>
    <style>
      div > span {
        color: rgb(255, 0, 0);
      }
    </style>
  </head>
  <body>
    <div>I am <span>MOHAMMAD</span>. I am from <span>Iran</span></div>
  </body>
</html>

ارسال جواب

جوابت را با Markdown بنویس و ثبت کن

×
بستن