میخواستم بدونم چرا وقتی بعد از اسم والد از first-of-type استفاده میکنم عمل نمیکنه؟
اصلا چجوری باید از first-of-type استفاده کرد؟
بخش html کد:
html>
<html lang="fa" dir="rtl" >
<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>Menutitle>
<link rel="stylesheet" href="style.css">
head>
<body>
<h1>suedo classesh1>
<section>
<p>سلام. چطوری؟p>
<br>
<h4>سلام. چطوری؟h4>
<br>
<p>سلام. چطوری؟p>
<br>
<h5>سلام. چطوری؟h5>
<br>
<div>سلام. چطوری؟div>
<br>
<p>سلام. چطوری؟p>
<br>
<div>سلام. چطوری؟div>
section>
body>
html>
بخش css کد:
@font-face {
font-family: vazir;
src: url("fonts/Vazirmatn-Medium.woff2") format(woff2);
}
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: vazir;
}
h1{
text-align: center;
background-color: aqua;
border-radius: 15px;
margin: 5px 10px;
}
section{
margin: 15px;
}
section :first-of-type{
background-color: rgb(211, 163, 91);
}