亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在反應中滾動頁面而不是 div 元素

在反應中滾動頁面而不是 div 元素

慕沐林林 2023-03-18 16:25:58
我正在使用具有父 div 的 react 制作我的網絡簡歷 - <div         className={`w-100  d-flex flex-column align-items-center m-0 position-absolute ${styles.container} `}       >在這里我有多個子 div 但是當我運行我的代碼時 div 的元素正在滾動而不是頁面。當我給父 div 高度但它在某些瀏覽器上工作不正常時我需要一個好的解決方案以便元素保持靜態和頁面滾動。提前致謝。https://utkarsh0911.github.io/my_web_resume/
查看完整描述

1 回答

?
人到中年有點甜

TA貢獻1895條經驗 獲得超7個贊

在您的 css 中刪除類“landing_container__23Tq8”的背景附件屬性。

您可以嘗試src/Pages/LandinPage.js使用以下代碼段進行更新。


import React, { Component ,Text,StyleSheet} from 'react'

import Logo from '../Images/SiteLogo/logo.jpg'

import MyNav from '../Components/MyNav'

import styles from '../css/landing.module.css'

import { Button, Container } from 'react-bootstrap'

import MyButton from '../Components/MyButton'

import Myphoto from '../Images/MyPhoto/photo.png'

import MyRoundedImage from '../Components/MyRoundedImage'

import AboutMe from './AboutMe'

import Experience from './Experience'

import Skills from './Skills'

import MySimpleImage from '../Components/MySimpleImage'

import Education from './Education'

import resume from '../docs/resume.pdf'

import MyFooter from '../Components/MyFooter'

import MyJumbo from '../Components/MyJumbo'



class LandingPage extends Component

{

    render() {

        return (



          <div className={ `w-100 d-flex flex-column align-items-center m-0 position-absolute ${styles.container} `} >


              <div className="container ">

            <MyNav title="MyResume" items={["ABOUT","BLOG","CONTACT"]}/>

            </div>


            <div className="d-flex justify-content-center ">

<h1 className={`font-weight-bold text-white text-center  ${styles.h1}`}>WELCOME TO MY STUDIO!!</h1>

</div>



            <div className="d-flex flex-wrap justify-content-center mt-2 ">





            <a href={resume} target="_blank" rel="noopener noreferrer" download>


           <MyButton   title="Download CV" variant="success"/></a>





<MyButton  title="Subscribe" variant="success"/>



           </div>



<div className="d-flex  flex-wrap clearfix  mt-1 flex-wrap justify-content-center align-items-center">

        <MyRoundedImage src={Myphoto}/>

        </div>


  <div className="bg-white">

    <AboutMe />

    <MyJumbo title="EXPERIENCE"/>




     <div className={styles.expContainer}>

    <Experience/>


    </div>




    <MyJumbo title="SKILLS"/>

    <Skills/>




    <MyJumbo title="EDUCATION"/>

    <Education/>

  </div>


{/* <MyFooter/> */}


            </div>


        )

    }

}





export default LandingPage


基本上,滾動很好;但是,abackground從后面的部分開始就不見了About Me。


祝你好運...


查看完整回答
反對 回復 2023-03-18
  • 1 回答
  • 0 關注
  • 95 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號