그는 내 응용 프로그램에 대한 표준 템플릿을 만들고 있습니다. 나는 CSS를 먹고 좋은 반응을 보이는 디자인을 만들기 위해 두통을 앓고 있습니다.내 CSS 반응성을 만드는 방법
지금이 내 생각이다 : 그것은 밖으로 작동하는 방법
이다 : 나는 아마이 작업을 수행 할 수있는 몇 가지 자바 스크립트로 지금
을하지만이 경우 CSS에서 가능하면 좋을 것입니다. 제 질문은 어떻게 HTML과 CSS로 디자인을 할 수 있을까요?
jsFiddle 단지 전면에 재미 :
내 CSS :
body{
font-family:"Trebuchet MS",sans-serif;
padding:0px;
margin:0px;
}
#content{
min-height: 100%;
width: 100%;
position: absolute;
background-color: #5adc23;
}
input[type="button"]{
border:2px outset rgb(166, 166, 166);
display:inline-block;
}
input[type="button"]:hover{
border:2px inset rgb(166, 166, 166);
display:inline-block;
cursor: pointer;
}
#mainbar{
height: 31px;
background-color: rgb(109, 164, 227);
background-image: -webkit-linear-gradient(0deg, rgb(39, 162, 207) 1%, rgb(63, 181, 224) 36%, rgb(63, 181, 224) 64%, rgb(39, 162, 207) 100%);
}
#mainbar_border{
height: 100%;
border-bottom:1px solid rgb(0, 0, 0);
color: rgb(255, 255, 255);
font-family: 'Courier New', serif;
font-size: 21px;
}
#mainmenu{
width: 40px;
height: 96%;
min-height: 100%;
margin-top: 0px;
margin-bottom: 0px;
float: left;
}
#mainmenu_border{
height: 99%;
padding: 4px;
padding-top: 46px;
padding-bottom: 19px;
border-bottom-width: 1px;
border-left-width: 1px;
border-bottom-style: solid;
border-left-style: solid;
}
#mainmenu_item_container{
list-style-type:none;
}
#content_app{
float: left;
width: 88%;
height: 96%;
}
#content_app_border{
height: 99%;
padding: 4px;
border-bottom-width: 1px;
border-left-width: 1px;
border-bottom-style: solid;
border-left-style: solid;
border-right-width: 1px;
border-right-style: solid;
}
내 HTML :
<div id='content' class='invoer'>
<div id='mainbar'>
<div id='mainbar_border'>
Mainbar
</div>
</div>
<div id='mainmenu'>
<div id='mainmenu_border'>
<ul id='mainmenu_item_container'>
<li><input type='button' value='Load content' title='load some more shit to test the resposive design' id='btn' action='loadmoreshit' /></li>
<li>button</li>
<li>button</li>
</ul>
</div>
</div>
<div id='content_app'>
<div id='content_app_border'>
content
<br>
<br>
<br>
</div>
</div>
</div>
더 많은 콘텐츠가있는 경우 #content 및 #left_nav를 확장해야하는 문제가 있습니다. http://jsfiddle.net/hfNCp/1/ 참조하십시오. – botenvouwer
글을 편집 한 후, 예제를 동적으로 높이를 확장 시켰습니다. 하지만 지금은 총 html 높이의 최소 높이 (헤더의 40px)를 만들어야합니다. 그래서 Javascript는 그렇습니다! – botenvouwer
이것을 시도하십시오 - http://jsfiddle.net/x6hsF/1/; 나는 그것이 당신이 찾고있는 것에 더 가까워 질 것이라고 생각합니다.이것은 콘텐츠 주변의 컨테이너를 사용하고'overflow : auto; '로 왼쪽 탐색을하고 왼쪽 탐색 및 내용은'min-height : 100 %;'로 설정되어 항상 화면의 맨 아래로 확장됩니다 컨텐트가 그 이상으로 확장되면 컨테이너는 스크롤바를 생성합니다. –