채택완료

반응형 매뉴 정렬

http://smiletrip.tk/

 

평상시에는 로그인 회원가입쪽 메뉴(clearfix2)가 오른쪽으로 정렬되있고

1100px이하로 줄어들면 왼쪽정렬이되도록 코드를 짜고 있습니다.

평상시에도 왼쪽 정렬이 되는대 무엇을 잘못한걸까요?

 

 

 

Copy
/* 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;
    }
}
|

답변 2개 / 댓글 2개

채택된 답변
+20 포인트

nav ul.clearfix2{

 

ul과 쩜을 붙이세요

답변에 대한 댓글 2개

나오긴 하는대 깨져서 나옵니다.
위에 답변에 사진을 올렸는대 1100xp 이하에서 깨져서 나오는대 이건 왜그런걸까요?

깨져서나옴thumb-1964057375_1525316393.8317_730x693.png

답변을 작성하려면 로그인이 필요합니다.