سؤال

هذا هو بلدي شفرة الذي يعمل بشكل جيد ولكن عندما أقوم بتغيير عنواني الرئيسي 2 إلى "سعر البيع 25 دولارًا".هذا نموذج نص.244 دولارًا أمريكيًا" ثم تغير صورة الشعار التلقائي موضعها.لا أريد أن يغير الشعار موضعه ولكن يجب أن يظل في مكانه ويجب ألا يتأثر بالعنوان الرئيسي2Txt.كيف يمكن اصلاح هذه المشكلة؟

 <div id="wrapper">
        <div id="mainContainer">
            <p class="copyrights" id="copyrights"></p>
            <div>
                <img id="Image_Car" src="http://i.share.pho.to/25a090ef_c.png" />
            </div>
                  <div id="headlineText">
            <p id="headline1Txt" >Sample bag1</p>
            <p id="headline2Txt" >Sale Price $25 </p>

        </div>
            <div id="disclaimer" >
               Details*
            </div>
              <div id="Image_logo">
                <img id="Imglogo" src="http://i.share.pho.to/93578bd4_o.png" />
            </div>

           <div >
           <button class="btn btn-primary" type="button"  id="ctaBtn"><div id="fadeIn" >  Learn More Now </div></button>

        </div>
    </div>


#Image_logo img
{
    position:relative;
    width:140px;
    height:30px;
    top:-3px;
left:390px;
}
</div>
هل كانت مفيدة؟

المحلول

لديك position: relative; على #شعار_الصورة img ومع ذلك تحاول وضعه "بالطريقة المطلقة".حاول تغيير CSS الخاص بك مثل هذا:

#Image_logo img {
    position:absolute;
    width:140px;
    height:30px;
    top:40px;
    left:390px;
}

نصائح أخرى

I may not understand what you're asking, but I think the lack of a float is throwing you. Adding some css like this..

<style>
#Image_logo img {
    width:140px;
    height:30px;
}
#wrapper {
    float:left;
}
</style>

...should work. It should be in a separate .css file of course.

Try giving your #Image_logo img position: absolute instead of relative, then modify top, left etc. Then it should be always in the same place;

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top