مشاركة حلول: التدرب على نموذج الصندوق

مهمة التدرب على نمذج الصندوق

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title> مهمة التدرب على نموذج الصندوق</title>
        <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet">
        <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet">
        <style>
            body{
                background-color: LightSlateGray;
            }
            p{
                background-color: royalblue;
                color: white;
                width: 400px;
                line-height: 36px;
                font-size: 18px;
                letter-spacing: 2px;
                font-family: 'Source Sans Pro', sans-serif;
                padding: 10px 20px 10px 20px;
                border: 5px inset blue;
                box-sizing: border-box;
                margin: 10px 20px 10px 20px;
                margin-left: auto;
                margin-right: auto;
            }
            div p{
                background-color: limegreen;
                color: white;
                width: 400px;
                line-height: 36px;
                font-size: 18px;
                letter-spacing: 2px;
                font-family: 'Source Sans Pro', sans-serif;
                border: 5px outset green;
            }
        </style>
    </head>
    <body>
        <p> Never give up. Today is hard, tomorrow will be worse,
            but the day after tomorrow will be sunshine</p>
        <div>
            <p>If you work just for money, you'll never make it, but if you
               love what you're doing success will be yours</p>
        </div>
    </body>
</html>

1 Like

عمل جميل طارق :+1:

ملاحظة واحدة:

قمت بإعطاء الفقرات هوامش من فوق وتحت بـ 10px ومن ثم من اليمين واليسار 20px بالكود التالي:

margin: 10px 20px 10px 20px;

وبعدين قمت بتغيير قيمة الـ margin من اليمين واليسار كلاً على حدة للقيمة auto بالأكواد التالية:

margin-left: auto;
margin-right: auto;

لا يوجد أي مشكلة في ذلك، لكن الأفضل هو ان تستغل كود الـ margin الذي يتكون من سطر واحد بتعديلة لتحقيق ذلك ومسح ذلك الكودين الزايدين على الللزوم و راح نحصل على نفس النتيجة بالشكل التالي:

margin: 10px auto 10px  auto;
1 Like

الحقيقة انك زوق جدا حتى فى التصحيح

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title> مهمة التدرب على نموذج الصندوق</title>
        <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet">
        <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet">
        <style>
            body{
                background-color: LightSlateGray;
            }
            p{
                background-color: royalblue;
                color: white;
                width: 400px;
                line-height: 36px;
                font-size: 18px;
                letter-spacing: 2px;
                font-family: 'Source Sans Pro', sans-serif;
                padding: 10px 20px 10px 20px;
                border: 5px inset blue;
                box-sizing: border-box;
                margin: 10px auto 10px auto;
            }
            div p{
                background-color: limegreen;
                color: white;
                width: 400px;
                line-height: 36px;
                font-size: 18px;
                letter-spacing: 2px;
                font-family: 'Source Sans Pro', sans-serif;
                border: 5px outset green;
            }
        </style>
    </head>
    <body>
        <p> Never give up. Today is hard, tomorrow will be worse,
            but the day after tomorrow will be sunshine</p>
        <div>
            <p>If you work just for money, you'll never make it, but if you
               love what you're doing success will be yours</p>
        </div>
    </body>
</html>


شكرا جزيلا

1 Like
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>مهمة التدرب على لغة التنسيقات</title>
        <link href="https://fonts.googleapis.com/css?family=Macondo+Swash+Caps" rel="stylesheet">
        <link href="https://fonts.googleapis.com/css?family=Calligraffitti|Macondo+Swash+Caps" rel="stylesheet">
    </head>
    <style>
        body {
            background-color: #F0FFFF;
        }
        p {
           width: 400px; 
           background-color: #20B2AA;
           color: #556B2F;
           font-family: 'Macondo Swash Caps', cursive;
           padding: 10px;
           text-align: center;
           border-left: 10px solid royalblue;
           margin-left: auto;
           margin-right: auto;
           box-sizing: border-box;
           

        }
        div p {
            width: 400px;
            background-color: #008B8B;
            color: #00FFFF;
            font-family: 'Macondo Swash Caps', cursive;
            font-family: 'Calligraffitti', cursive;
            text-decoration: underline  lightblue;
        }
        
    </style>
    <body>
        
        <p>
            Never give up. Today is hard, tomorrow will be worse, 
            but the day after tomorrow will be sunsahine
        </p>
        
        
        <div>
            <p>
                If you work just for money, you'll never make it, 
                but if you love what you're doing success will be yours
            </p>
        </div>
        
    </body>
</html>

1 Like

رائع ياسين :+1::star_struck:

ملاحظة واحدة:

قمت بتكرار الخاصية font-family

font-family: 'Macondo Swash Caps', cursive;
font-family: 'Calligraffitti', cursive;

في هذه الحالة لم يعد للخاصية الاولى أي تأثير لذا لا يوجد داعي لإبقائها. بإمكانك الإكتفاء السطر الثاني

1 Like

أعتذر على خطأ…

1 Like

هذا ليس خطأ.

بالمناسبة لا نكتسب الخبرة الا بإرتكاب الأخطاء :blush:

2 Likes

التدريب على نموذج الصندوق

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>مهمة التدرب على لغة التنسيقات</title>
        <link href="https://fonts.googleapis.com/css?family=Stylish" rel="stylesheet">
        <link href="https://fonts.googleapis.com/css?family=Akronim" rel="stylesheet">
    </head>
    <style>
        p{
            background-color: LIGHTSALMON;
            color: blue;
            width: 300px;
            text-align: center;
            text-transform: none;
            font-family: 'Stylish', sans-serif;
            front-siz: 30px;
            front-weight: bold;
            line-height: 40px;
            padding: 20px;
            border-left: 10px solid MEDIUMVIOLETRED;
            border-right: 10px solid MEDIUMVIOLETRED;
            box-sizing: border-box;
            margin-left: auto;
            margin-right: auto;
            
        }
        div p{
            background-color: LIGHTSALMON;
            color: DARKRED;
            width: 300px;
            font-family: 'Akronim', cursive;
            font-size: 30px;
            text-align: center;
            text-transform: capitalize;
            line-height: 40px;
            text-decoration: underline wavy red;
            padding: 20px;
            border-left: 10px solid GOLD;
            border-right: 10px solid GOLD;
            box-sizing: border-box;
            margin-left: auto;
            margin-right: auto;
        }
        body{
            background-color: black;
        }
    </style>
    <body>
        
        <p>
            Never give up. Today is hard, tomorrow will be worse, 
            but the day after tomorrow will be sunsahine
        </p>
        <hr>
        <div>
            <p>If you work just for money, you'll never make it, 
            but if you love what you're doing success will be yours</p>
        </div>
        
    </body>
</html>
1 Like

رائع ي هشام

1 Like
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>مهمة التدرب على لغة التنسيقات</title>
    </head>
    <style>
      body {
        background-color: #333;
      }
      
      p {
        width: 400px;
        font: 15px/30px "Comic Sans MS", cursive, sans-serif;
        letter-spacing: 1px;
        box-sizing: border-box;
        padding: 10px;
        margin: 15px auto;  
      }
      
      .first-p {
        background-color: #63131b;
        color: #fff;
        text-decoration: underline;
        border-left: 10px solid #fff;
      }
      
      .second-p {
        background-color: #fff;
        color: #63131b;
        font-weight: bold;
        border-left: 10px solid #63131b;
      }
    </style>
    <body>
        
        <p class="first-p">
            Never give up. Today is hard, tomorrow will be worse, 
            but the day after tomorrow will be sunsahine
        </p>
        
        <p class="second-p">
            If you work just for money, you'll never make it, 
            but if you love what you're doing success will be yours
        </p>
        
    </body>
</html>
1 Like

مية مية :100:

1 Like

@Alhakem

<!DOCTYPE html>
<html>
 <head>
  <meta charset="utf-8">
  <title>مهمة التدرب على لغة التنسيقات</title>
  
  <link href="https://fonts.googleapis.com/css?family=Cute+Font&display=swap" rel="stylesheet">
  
  <link href="https://fonts.googleapis.com/css?family=Pacifico&display=swap" rel="stylesheet">
  
  <style>
    body{
    	background-color:LAVENDER;
    }
    
    p{
    	width:600px;
    	background-color:#A569BD;
    	font-size:40px;
    	color:#ffffff;
    	line- height:50px;
    	font-family: 'Cute Font', cursive;
    	text-transform:uppercase;
    	text-align:center;
    	margin-top:30px;
    	margin-left:auto;
    	margin-right:auto;
    	padding:30px;
    	box-sizing:border-box;
    	border-left:6px dotted MEDIUMVIOLETRED;
    }
    
    div p{
    	 
    	 background-color:#BB8FCE;
    	 font-family: 'Pacifico', cursive;
    	 font-size:30px;
    	 color:#000000;
    	 text-transform:none;
    	 text-decoration:underline wavy purple;
    	 
    
    }
    
  </style>
 </head>
 <body>
    <p> Never give up. Today is hard, tomorrow will be worse, but the day after tomorrow will be sunshine </p>
    <div>
     <p> If you work just for money, you'll never make it, but if you love what you're doing success will be yours </p>
    </div>
 </body>
</html>

1 Like

Perfect :ok_hand:

1 Like

اليكم محاولتي ^^

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>مهمة التدرب على لغة التنسيقات</title>
        <link href="https://fonts.googleapis.com/css?family=Inconsolata&display=swap" rel="stylesheet">
        <link href="https://fonts.googleapis.com/css?family=Inconsolata|Indie+Flower&display=swap" rel="stylesheet">
    </head>
    <style>
        body {
            background: #483D8B;
            
        }
        p {
            background: #E6E6FA;
            width:400px;
            font-weight: 700;
            padding: 20px;
            margin-left: auto;
            margin-right: auto;
            font-family: 'Inconsolata', monospace;
            border-left: 5px solid red;
        }
        div p {
            background: #E6E6FA;
            font-size: 18px;
            text-decoration: underline wavy green;
            font-family: 'Indie Flower', cursive;
        }
    </style>
    <body>
        
        <p>
            Never give up. Today is hard, tomorrow will be worse, 
            but the day after tomorrow will be sunsahine
        </p>
        
        <div>
            <p>
            If you work just for money, you'll never make it, 
            but if you love what you're doing success will be yours
            </p>
        </div>
        
    </body>
</html>

textDec

2 Likes

رائعة ي كمال إستمر :blush:

1 Like
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>مهمة التدرب على لغة التنسيقات</title>
    </head>
    <style>
        body{
            background-color: #02B2A5;
            }
        p{
            width: 400px; 
            background-color: #ffffff;
            color: #10635C;
            font-family: 'Merriweather', serif;
            font-size: 18px;
            font-weight: 600;
            text-align: left;
            line-height: 30px;
            text-decoration: underline double #0E5F59;
            padding: 10px 10px 10px 5px;
            border-left: 10px outset #0E5F59;
            border-top: 5px outset #0E5F59;
            box-sizing: border-box;
            margin-left: auto;
            margin-right: auto;
            
          }
        
               
        div p{
            background-color: #0E5F59;
            color: #DEFAF8;
            font-family: 'Indie Flower', cursive;
            font-size: 18px;
            font-weight: 400;
            text-align: center;
            text-transform: capitalize;
            letter-spacing: 1px;
            line-height: 25px;
            text-decoration: none;
            border-left: 10px ridge #EEE;
            border-bottom: 5px ridge #EEE;
             }
    </style>
    <body>
        
        <p>
            Never give up. Today is hard, tomorrow will be worse, 
            but the day after tomorrow will be sunsahine
        </p>
        
        <div>
        <p>
            If you work just for money, you'll never make it, 
            but if you love what you're doing success will be yours
        </p>
        </div>
        
    </body>
</html>

Capture

2 Likes

ممتاز :clap:

1 Like
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>مهمة التدرب على لغة التنسيقات</title>
        <link href="https://fonts.googleapis.com/css?family=ZCOOL+KuaiLe&display=swap" rel="stylesheet">
    </head>
    <style>
        body {
            background-color: #375A63;
        }
        p {
            font-family: monospace;
            color: #F4EFE6;
            width: 400px;
            padding: 5px;
            border-radius: 3px;
            background-color: #ECB172;
        }
        div p {
            font-family: 'ZCOOL KuaiLe', cursive;
            line-height: 30px;
            font-size: 11px;
            text-decoration: underline;
            text-transform: uppercase; 
            background-color: #7FA7B8;
        }
        p,div p {
            margin: 10px auto;
            border-left: 5px solid #F0FFFF;
        }
    </style>
    <body>
        
        <p>
            Never give up. Today is hard, tomorrow will be worse, 
            but the day after tomorrow will be sunsahine
        </p>
        
        <div>
            <p>
                If you work just for money, you'll never make it, 
                but if you love what you're doing success will be yours
            </p>
        </div>
    </body>
</html>

1 Like

p,div p { margin: 10px auto; border-left: 5px solid #F0FFFF; }

مش محتاج لدى

<style>
        body {
            background-color: #375A63;
        }
        p {
            font-family: monospace;
            color: #F4EFE6;
            width: 400px;
            padding: 5px;
            border-radius: 3px;
            background-color: #ECB172;
            margin: 10px auto;
            border-left: 5px solid #F0FFFF;
        }
        div p {
            font-family: 'ZCOOL KuaiLe', cursive;
            line-height: 30px;
            font-size: 11px;
            text-decoration: underline;
            text-transform: uppercase; 
            background-color: #7FA7B8;
        }
    </style>
1 Like

@abdallahmiri
شغل رائع ي عبدالله :star_struck: :+1:

1 Like