تسليم حلول: مهمة التدرب على الـ ID

<!DOCTYPE html>
<html>
    <head>
       <meta charset="UTF-8">
       <meta name="viewport" content="width=device-width, initial-scale=1.0">
       <title>test2</title>
       <style>
       	div {
       		width:100px;
       		height:100px;
       		border: 40px;
       		display:inline-block;
       		padding:20px;
       		margin:20px;
       		box-sizing: border-box;

       	}
       	#leem_le{
       		background-color:red;
       		
       	}
       	#acer_n{
       		background-color:green;
       		
       	}
       	#deep_o{
       		background-color:blue;
       		
       	}
    </style>
    </head>
    <body>
    	<div id="leem_le"></div>
    	<div id="acer_n"></div>
    	<div id="deep_o"></div>
    </body>
    </html>

1 Like

مية مية :+1:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Test ID</title>
    <style>
        div{    
                        width: 200px;
                        height: 200px;
                        display: inline-block;
                    }
        #red{
            background-color: red;
        }
        #green{
            background-color: green;
        }
        #blue{
            background-color: blue;
        }
    </style>
</head>
<body>
    <div id="red"></div>
    <div id="green"></div>
    <div id="blue"></div>
</body>
</html>
1 Like

1 Like

مية مية :100:

1 Like
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        div{
            display: inline-block;
            width: 75px;
            height: 75px;
            margin: 15px;
        }
        #one{
            background-color: red;
        }
        #two{
            background-color: green;
        }
        #three{
            background-color: blue;
        }
    </style>
</head>
<body>
    <div id="one"></div>
    <div id="two"></div>
    <div id="three"></div>
    
</body>
</html>

سؤال: هل هناك أي قواعد في تسمية ال ID؟

1 Like

على حسب اللي تعلمته بفيدك واذا في اضافات الشباب والمطورين اللي هنا ما راح يقصرون معك
القواعد هي :

  1. لازم تبتدي بحرف سواء احرف كبيرة أو صغيرة
  2. تجنب انك تسوي نفس اسم id على واحد ثاني لانه ما زي الكلاس تفرق لازم يكون شئ مميز غير موجود بالصفحة وكان مثلناها بصورة مثل البطاقة الجامعيه يميز الشخص برقم البطاقة الخاص به مثل ال id واذا لم يكن معك يميز ب اسم الكليه او المجال واللتي يمكن تمثيلها بال class
  3. الفاصل بين الكلمة وغيرها علامات شرطية مثل - _ أو يمكنك استخدام : أو نقطة . ولكن كما حدد لنا وقال يفضل استحدام الشرطة هذه - لانها مشهورة دوليا واغلب المطورين يستخدموها
2 Likes
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name= viewport content= width=device-width, initial-scale=1> 
        <title>ID Test </title>
        <style>
            div{
                width: 50px;
                height: 50px;
                padding: 10px;
                margin: 5px;
                display: inline-block;
            }
            #red-color{
                background-color: red;
            }
            #green-color{
                background-color: green;
            }
            #blue-color{
                background-color: blue;
            }
        </style>
    </head>
    <body>
        <div id="red-color"></div>
        <div id="green-color"></div>
        <div id="blue-color"></div>


    </body>
</html>
1 Like

Perfect :+1:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        div{
            display: inline-block;
            width: 250px;
            height: 300px;
            margin: 10px;
            
        }
        #red{
            background-color: red;
        
        }
        #green {
            background-color: green;
        }
        #blue{
            background-color: blue;
        }
    
    
    </style>
</head>
<body>
    <div id="red" ></div>
    <div id="green"></div>
    <div id="blue"></div>


</body>
</html>

1 Like

ممتاز :+1:

2 Likes

ممتاز، أرجوا وضع الأكواد مباشرة بدون وضع صور للمحرر

هنا مرجع لكيفية القيام بذلك:

1 Like
<!DOCTYPE html>
<html>

  <head>
    <link rel="stylesheet" href="normalize.css" />
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>STORE</title>
    <link rel="stylesheet" href="css/style.css">
  </head>

  <body>
    <div id="red"></div>
    <div id="green"></div>
		<div id="blue"></div>
  </body>

</html>

div {
  width: 100px;
  height: 100px;
	margin: 20px;
	display: inline-block;
  
}

#red {
	background-color: red;
}

#green {
	background-color: green;
}

#blue {
	background-color: blue;
}

1 Like
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title></title>
        <style>
           div{
             display:inline-block;
             width:200px;
             height:200px;
             margin:10px;
           }
           #color-red{
             background-color:red;
           }
           #color-green{
             background-color:green;
           }
           #color-blue{
             background-color:blue;
           }
        </style>
    </head>
    <body>
      <div id="color-red"></div>
      <div id="color-green"></div>
      <div id="color-blue"></div>

    </body>
</html>

1 Like

ممتاز أنس :clap:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>Attribute ID</title>
    </head>
    <style>
        div{
          display: inline-block;
          width: 150px;
          height: 150px;  
        }
        #red{
            background-color: red;
        }
        #green{
            background-color: green;
        }
        #blue{
            background-color: blue;
        }
    </style>
    <body>
        <div id="red"></div>
        <div id="green"></div>
        <div id="blue"></div>
    </body>
</html>
2 Likes
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            margin: 20px;
            display: inline-block;
            width: 100px;
            height: 100px;
        }
        #red-box{
            background-color: red;
        }

        #green-box{
            background-color: green;
        }

        #blue-box{
            background-color: blue;
        }
    </style>
</head>
<body>
    <div id="red-box"></div>
    <div id="green-box"></div>
    <div id="blue-box"></div>
</body>
</html>
2 Likes

مهمة التدرب على الـ ID

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>مهمة التدرب على لغة التنسيقات</title>
    </head>
    <style>
        div{
            display: inline-block;
            width: 200px;
            height: 200px;
            margin: 30px;          
        }

        #Red_Color{
            background-color: red;
        }

        #Green_Color{
            background-color: green;
        }

        #Blue_Color{
            background-color: blue;
        }
    </style>
    <body>
        
      <div id="Red_Color"></div>
      <div id="Green_Color"></div>
      <div id="Blue_Color"></div>
        
    </body>
</html>
2 Likes

2 Likes