• 1399/04/09

روش استفاده id :

سلام خدمت استاد گرامی

سوال من درباره id هست

گفتین که در  یک صفحه html فقط برای یک تگ میشه یک id داد من مثال زیر رو زدم و به دو تگ یک id دادم

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        #test{
            color: red;
        }   
    </style>
</head>
<body>
<h1 id="test">Hello</h1>
<h1 id="test">Hi</h1idtest>
</body>
</html>
  • 1399/04/09
  • ساعت 18:41

با سلام خدمت شما همراه عزیز

 

بله شدن میشه ولی اصلا اصولی نیست و کاملا رد شده این کار


logo-samandehi