너비가 60 % 인 콘텐츠 섹션이 있습니다. 위의 경우 40 % 너비의 텍스트 입력이 있습니다. 해당 입력 필드 옆에 제출 버튼이 있습니다. 내 수학 지식에 따르면, 입력 필드와 내용 섹션은 모두 같은 너비를 가져야합니다. | _________ 40 % _________ || ____ 20 % ____ |
| _______________ 60 % ________________ |
하지만 그건 사실이 아닙니다.
HTML :CSS 너비가 정확하지 않습니다/나에게 이해가되지 않습니다
<input id="plannername" placeholder="Name eingeben" type="text"></input><!--
--><input id="plannersubmit" type="submit" value="eintragen"></input>
<div id="content"></div>
CSS :
#plannername{ /* The text input */
width:40%;
background-color:#9eefbc;
margin-left:20%;
border:0;
font-size:2em;
padding:20px;
}
#plannersubmit{ /* The submit button */
width:20%;
background-color:#6dce91;
border:0;
font-size:2em;
padding:20px;
transition:.2s ease-in-out;
}
#content{
width:60%;
background-color:#9eefbc;
height:500px;
margin-left:20%;
padding-top:70px;
margin-top:3px;
}
내 전체 코드가 여기에 있습니다 : http://codepen.io/tobiasglaus/pen/xgBeaJ