반응형 매뉴 정렬
본문
평상시에는 로그인 회원가입쪽 메뉴(clearfix2)가 오른쪽으로 정렬되있고
1100px이하로 줄어들면 왼쪽정렬이되도록 코드를 짜고 있습니다.
평상시에도 왼쪽 정렬이 되는대 무엇을 잘못한걸까요?
/* clearfix */
.clearfix:before, .clearfix:after{
content:"";, display: table;
}
.clearfix:after{
clear:both;
}
.clearfix{
*zoom:1;
}
nav{
height: 40px;
width: 100%;
background: #455868;
font-size: 11pt;
font-family: 'PT Sans', Arial, Sans-serif;
font-weight: bold;
position: relative;
border-bottom: 2px solid #283744;
}
nav ul .clearfix{
padding: 0;
position: relative;
float:left;
width: 940px;
height: 40px;
}
nav li{
display: inline;
float: left;
}
nav ul .clearfix2{
width: auto;
position:relative;
float: right;
}
nav a{
color: #fff;
display: inline-block;
width: auto;
padding: 0 10px 0 10px;
text-align: center;
text-decoration: none;
line-height: 40px;
text-shadow: 1px 1px 0px #283744;
}
nav li a{
border-right: 1px solid #576979;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
nav li:last-child a{
border-right: 0;
}
nav a:hover, nav a:active{
background-color: #8c99a4;
}
nav a#pull{
display: none;
}
/*Styles for screen 600px and lower*/
@media only screen and (max-width : 1100px) {
nav {
border-bottom: 0;
height: auto;
}
nav ul {
display: none;
height: auto;
}
nav ul .clearfix2
{
float: left;
}
nav a {
text-align: left;
width: 100%;
text-indent: 25px;
}
nav a#pull {
display: block;
background-color: #283744;
width: 100%;
position: relative;
}
nav a#pull:after {
content:"";
background: url('nav-icon.png') no-repeat;
width: 30px;
height: 30px;
display: inline-block;
position: absolute;
right: 15px;
top: 10px;
}
nav li {
display: block;
float: none;
width: 100%;
}
nav li a {
border-bottom: 1px solid #576979;
}
}
답변을 작성하시기 전에 로그인 해주세요.