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

كيف يمكنني معالجة scroll الذي في أسفل الصفحة ؟

عبدالله غازي

السؤال

السلام عليكم ,

1-لا ادري لماذا يوجد scroll في صفحه ال indexوايضا ال contact ؟؟ حاولت معرفه السبب ولكني لم استطع

2- في صفحه ال index اريد ان اجعل قسم ال hero في المنتصف القسم المحدد في الصوره 

index.html 

 

<!-- Start Header -->
<header>
  <div>
    <a class="logo">
      <!-- <img src="./images/scooter.png" width= "150" height="100" alt=""> -->
      <span class="firstL">S</span>COOTER
    </a>
  </div>

  <div>
    <a class="active" href="home.html">Home</a>
    <a href="about.html">About</a>
    <a href="contact.html">Contact</a>
  </div>
</header>
<!-- End Header -->

<section class="hero">
  <div class="left-part">
    <!-- <div class=""><hr /></div> -->
    <h1>Buy the best Scooter ever</h1>
    <p>A scooter or motor scooter is a motorcycle with an underbone or step-through frame and a platform for the rider's feet, emphasizing comfort and fuel economy.</p>
    <div class="line">
      <hr />
    </div>
  </div>
  <div class="right-part">
    <div class="shape"></div>
    <img src="./images/IMG_9593.PNG" height="300px" width="300px" alt="" />
  </div>
</section>

contact.html 

<div class="contactBody">
        <section class="info">
                <h1>
                    Contact Us
                </h1>
                <div class="con-img">
                    <img src="./images/IMG_9591.PNG"  height="300px" width="300px" alt="">
                </div>
            <form>
                <div class="name">
                    <!-- <label">Name</label> -->
                    <input placeholder="Name" type="text">
                </div>
                <div class="email">
                    <!-- <label">Name</label> -->
                    <input placeholder="Email" type="email">
                </div>
                <div class="number">
                    <!-- <label">Name</label> -->
                    <input placeholder="Your phone number" type="text">
                </div>
                <div>
                    <input type="button" value="SUBMIT">
                </div>
            </form>
            <!-- <div class="con-img">
                <img src="./images/IMG_9591.PNG"  height="300px" width="300px" alt="">
            </div> -->
        </section>
    </div>

style.css

header {
  display: flex;
  width: 100vw;
  height: 3rem;
  justify-content: space-between;
  align-items: center;
  padding-left: 5rem;
  padding-right: 5rem;
}

.hero {
  margin-top: 5rem;
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100vw;
}

/* Contact page */


.info {
  width: 100%;
  margin-left: 5rem;
  margin-top: 3rem;
}

وشكرا 

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

Recommended Posts

  • 0

اهلا اخي اسامه لا ادري اين سيكون الخطا وايضا ملف ال css طويل ولا ادري اين ممكن يكون الخطا ولذالك ارفقت الملفات كامله انا لدي مشكله ال scroll على محور x في صفحه ال index وايضا contact

 

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

  • 0

سبب في مشكلة scroll  هو حجم width المعطى لعدّة عناصر، لذلك عليك حذف التسيق   width: 100vw; من تسبيقات header و الكلاس hero . لتصبح كتالي 

header {
  display: flex;
  height: 3rem;
  justify-content: space-between;
  align-items: center;
  padding-left: 5rem;
  padding-right: 5rem;
}

.hero {
  margin-top: 5rem;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

وتنسيق margin-left: 5rem; من الكلاسinfo الخاص بالتنسيقات بصفحة Contact ليصبح الكتالي 

.info {
  width: 100%;
  margin-top: 3rem;
}

ولجعل قسم hero في المنتصف يمكنك عمل التالي ، أولاً نضيف كل عناصر التي داخل section في div جديد ونعطيه التنسيق margin: 0 auto;  كتالي

<section class="hero">
  <div style="margin: 0 auto;">
    <div class="left-part">
      <!-- <div class=""><hr /></div> -->
      <h1>Buy the best Scooter ever</h1>
      <p>A scooter or motor scooter is a motorcycle with an underbone or step-through frame and a platform for the rider's feet, emphasizing comfort and fuel economy.</p>
      <div class="line">
        <hr />
      </div>
    </div>
    <div class="right-part">
      <div class="shape"></div>
      <img src="./images/IMG_9593.PNG" height="300px" width="300px" alt="" />
    </div>
  </div>
</section>

ثم في css نقوم بإعطاء التنسيقات التالية للكلاسات left-part و right-part

.left-part {
  width: 50%;
  float: left;
}

.right-part {
  width: 50%;
  float: right;
}

//لتحريك الصورة نحو اليمين 

.right-part img {
  float: right;
}

 

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

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

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

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

×   لقد أضفت محتوى بخط أو تنسيق مختلف.   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.

  • إعلانات

  • تابعنا على



×
×
  • أضف...