간단한 반응 앱을 구축 중입니다. 다음은 렌더링 후 내 index.html을은 다음과 같습니다<html>보다 큰 요소 <body>
<html><head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Hello react!</title>
<link rel="stylesheet" href="./dist/styles/main.css" type="text/css">
</head>
<body>
<div id="App"><div data-reactroot="" class="navbar"><p>This will be the navbar</p></div></div>
<script src="./dist/components/main.js"></script>
<style>
body {
margin: 0;
}
</style>
</body></html>
지금까지 내 main.css가 파일에 내가 가진 유일한 판결 :
.navbar{
background-color:blue
}
#App{
height:500px;
background-color:pink
}
무엇 내 몸 태그가 전에 약간의 공백을 갖는 것을 발생 시작됩니다. 내 HTML 태그와 body 태그에는 여백이나 패딩이 없어 보이지만 페이지 상단에서 시작하는 대신 몸체가 몇 픽셀 더 아래로 시작됩니다 ...
따라서 <html>
은 400x516 픽셀이며 <body>
은 400x500px입니다. 시체가 html 요소를 완전히 채우고 싶습니다.
더 자세한 정보가 필요하면 git repo에게 문의하십시오. npm run start
을 실행하면 8080에 서버가 열립니다.
도움 주셔서 감사합니다.