برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام
div > 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; /* تغییر رنگ متن به قرمز */
}
<!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>
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام