اذهب إلى المحتوى
  • 0

after and before في css

Mahmoud Ali Nawwar

السؤال

السلام عليكم ورحمة الله وبركاته 

أريج أن أصنع مثل ذا الشكل ولقد صنعته بالا after and before ولكن عناصر ال after and before تظهر فوق العنصر الأصلي حاةلت استخدام z-index ولكن الأمر لم ينجح

oo.zip

Screenshot 2022-02-09 055515.jpg

رابط هذا التعليق
شارك على الشبكات الإجتماعية

Recommended Posts

  • 0

حاول أن تجعل قيمة z-index سالبة , فبدلا من صفر حاول أن تجعلها -1 كالتالي

.z::after{
content: "";
    width: 400px;
    height: 400px;
    border-radius: 50%;
 background-color: blueviolet;
position: absolute;
top: 0px;
left: 60px;
z-index: -1;
^^^^^^^^^^^^^^

    }

وبالمثل ل before

    .z::before{
        content: "";
            width: 400px;
            height: 400px;
            border-radius: 50%;
         background-color: forestgreen;
        position: absolute;
        top: 0px;
        right: 60px;
        z-index: -1;
        ^^^^^^^^^^^
        
            }

 

رابط هذا التعليق
شارك على الشبكات الإجتماعية

  • 0
بتاريخ 3 دقائق مضت قال محمد أبو عواد:

حاول أن تجعل قيمة z-index سالبة , فبدلا من صفر حاول أن تجعلها -1 كالتالي


.z::after{
content: "";
    width: 400px;
    height: 400px;
    border-radius: 50%;
 background-color: blueviolet;
position: absolute;
top: 0px;
left: 60px;
z-index: -1;
^^^^^^^^^^^^^^

    }

وبالمثل ل before


    .z::before{
        content: "";
            width: 400px;
            height: 400px;
            border-radius: 50%;
         background-color: forestgreen;
        position: absolute;
        top: 0px;
        right: 60px;
        z-index: -1;
        ^^^^^^^^^^^
        
            }

 

فعلت ذلك ولكن الكلام ظهر بعطس خلفية المحتوى

Screenshot 2022-02-09 061228.jpg

رابط هذا التعليق
شارك على الشبكات الإجتماعية

  • 0
بتاريخ 2 ساعات قال Mahmoud Ali Nawwar:

فعلت ذلك ولكن الكلام ظهر بعطس خلفية المحتوى

يمكننك اعطاء الصنف parent1 خاصية position وقيمتها relative كالتالي

.parent1 {
    width: 800px;
    height: 600px;
    background-color: bisque;
    margin: auto;
    overflow: hidden;
    z-index: 75;
    position: relative;
^^^^^^^^^^^^^^^^^^^^^^^^^
}

ويمكنك ازالة الخاصية z-index من الصنف z , لاحظ

.z {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    margin: 100px auto;
    background-color: aqua;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 5;
   ^^^^^^^^^^^^
}

بعد الازالة

.z {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    margin: 100px auto;
    background-color: aqua;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    
}

وسوف تظهر الخلفية 

رابط هذا التعليق
شارك على الشبكات الإجتماعية

انضم إلى النقاش

يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.

زائر
أجب على هذا السؤال...

×   لقد أضفت محتوى بخط أو تنسيق مختلف.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   جرى استعادة المحتوى السابق..   امسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

  • إعلانات

  • تابعنا على



×
×
  • أضف...