2013-07-28 4 views
0

웹 사이트를 만들고 현재 기본 탐색 모음에서 작업 중입니다. 요소가 정렬되도록하는 데 문제가있는 것 같습니다. 오른쪽 상단에 햄버거 메뉴 아이콘을 추가하기 전까지는 대부분 괜찮 았습니다. Screenshot탐색 모음의 정렬되지 않은 요소

링크를 그대로 유지하면서 로고 및 햄버거 아이콘을 페이지 가장자리로 가져 오려면 플로팅을 켜는 것과 관련이 있다고 생각합니다.

다음은 탐색 바의 소스 코드입니다. (PHP 실행 후)

<html lang="en"> 
<head> 
    <meta charset="utf-8"> 
    <title>Alexworks</title> 
    <link rel="stylesheet" type="text/css" href="/resources/CSS/main.css" media="screen" /> 
<body><nav id="navigation"> 
    <ul> 
     <li id="logo"><a href="http://alexandstein.com/">Alexworks</a></li> 
     <li><a href="http://alexandstein.com/main/about">About</a></li> 
     <li><a href="http://alexandstein.com/main/projects">Projects</a></li> 
     <li><a href="http://alexandstein.com/main/meta">Meta</a></li> 
     <li id="hamburger"><img src="http://alexandstein.com/resources/images/icons/hamburger.png" alt="Menu" class="iconSmall"/>  </li> 
    </ul> 
</nav><div id="content"> 

다음은 탐색 모음과 관련된 CSS입니다.

body{ 
    font-family: helvetica; 
    font-size: 1.1em; 
    margin: 0%; 
    padding-top: 0%; 
} 

#navigation{ 
    list-style-type: none; 
    text-align: center; 
    width: 100%; 
    margin: 0%; 
    padding: 0%; 

    background-color: black; 
    height: 2em; 
} 
#navigation ul{ 
    margin: 0%; 
    padding: 0%; 
    padding-top: 0%; 
} 
#navigation a{ 
    color: #aaa; 
} 
#navigation a:visited{ 
    color: #999; 
} 
#navigation a:hover{ 
    color: #bbb; 
} 
#navigation li{ 
    display: inline-block; 
    width: 15em; 
    height: 1.8em; 

    border-bottom-style: solid; 
    border-bottom-color: red; 
} 
#navigation li:hover{ 
    background-color: #333; 
} 
#navigation .iconSmall{ 
    width: 30px; 
    height:30px; 
} 
#navigation #logo{ 
    display: inline-block; 
    text-align: left; 
    width: inherit; 
    float:left; 
    letter-spacing: 5px; 
} 
#navigation #links{ 
    display: inline-block; 
} 
#navigation #hamburger{ 
    width: 30px; 
    border-bottom-style: none 
    float: right; 
} 

a{ 
    text-decoration: none; 
} 

지저분한 코드를 사용하지 마십시오. 나는 하이퍼 텍스트와 스타일 시트가 아닌 프로그래밍에 익숙하다.

답변

2

문제는 border-bottom-style: none

수정 후 CSS에서 누락 된 ; 세미콜론 :

#navigation #hamburger{ 
    width: 30px; 
    border-bottom-style: none; 
    float: right; 
} 

데모 : http://jsfiddle.net/pratik136/yCV6D/

+0

아, 감사합니다! 멍청한 작은 실수. – Saxophlutist

+0

@Alexandstein - Nae 괴롭히기! 쉬운 일 :) – bPratik

관련 문제