나는 HTML/CSS를 시작하고 있으며 나는 자신의 웹 사이트를 작성하려고합니다. 그러나 헤더, 기본 컨텐트 div 및 바닥 글이 필요합니다. 메인 콘텐츠 div 안에는 왼쪽 막대와 오른쪽 막대를 넣으려고하지만 불행히도 왼쪽 막대는 항상 div에서 빠져 있습니다 ... 내가 뭘 잘못하고 있니? 내가 잘못 뭐하는 거지DIV 안에 CSS DIV
body {
background-color: black;
}
p {
color: white;
}
#header {
background-color: grey;
margin-left: 100px;
margin-right: 100px;
border-radius: 5px;
text-align: centaer;
/*change later*/
}
#content {
background-color: green;
margin-top: 20px;
margin-bottom: 20px;
margin-left: 100px;
margin-right: 100px;
border-radius: 5px;
padding: 50px;
}
#leftBar {
background-color: orange;
left: 20px;
right: 20px;
top: 20px;
float: left;
color: white;
width: 20%;
height: 60%;
display: block;
}
#footer {
background-color: gray;
margin-bottom: 20px;
margin-top: 20px;
margin-right: 100px;
margin-left: 100px;
border-radius: 5px;
text-align: center;
/*change later*/
}
Here is my HTML
<html>
<head>
<title>Titel</title>
<link rel="stylesheet" type="text/css" href="FirstpageCSS/mainstyle.css" />
</head>
<body>
<p>Formatierter Inhalt</p>
<div id="header">HEADER</div>
<div id="content">this is going to be the content
<p>lol</p>
</div>
<div id="leftBar">contentntntntntnntnt</div>
<div id="footer">FOOTER</div </body>
</html>
: 여기
내 CSS입니까? 나는 포지셔닝에 관한 그 무언가를 안다. 그러나 나는 항상 그걸로 혼란스러워한다. ...초보자로서의 도움 감사.
'# leftBar'는 HTML 코드의'# content' 밖에 있습니다. 또한 ['float'] (https://developer.mozilla.org/en-US/docs/Web/CSS/float)는 "정상 흐름에서 요소를 가져와야한다고 지정합니다"; [수레를 지울 필요가 있습니다] (https://developer.mozilla.org/en-US/docs/Web/CSS/clear). [어떤 방법으로 'clearfix'를 사용할 수 있습니까?] (http://stackoverflow.com/questions/211383/what-methods-of-clearfix-can-i-use) – showdev