You must be logged in to access this section.
Login/Sign updiv > span { color: red; }
<!DOCTYPE html>
<html>
<head>
<style>
div > span{
color:red;
}
</style>
</head>
<body>
<div>
<span>
yes
</span>
<p>
no
</p>
</div>
</body>
</html>
<!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>
div span{
color:#ff0000;
}
<!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>
div > span { color: red; # Change the color of the text to the red }
<!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>
Submitting answers is currently unavailable.
You must be logged in to access this section.
Login/Sign up If you don’t understand the exercise or can’t solve it for any reason, that’s completely
normal—don’t worry 😊
Try checking out easier exercises and reviewing different answers
submitted by others. Gradually, you can move on to more challenging exercises. Also, your answer
might be correct even if it’s different from others.