2013-10-17 2 views
0

나는 단지 CSS 효과를 보여 주려고했습니다. 마우스가 메뉴로 이동하면 하위 메뉴가 위에서 아래로 슬라이드해야합니다. FIREFOX에서 작동하지만 크롬은 아래에서 위로 가고있었습니다. 아래 HTML 파일입니다.Google 크롬에서 출력을 표시 할 수 없습니다

<head> 

    <link media="all" href="alshop_menu_box.css" type="text/css" rel="stylesheet"> 

    <link media="all" href="alshop_menu_style.css" type="text/css" rel="stylesheet"> 

    <link media="all" href="alshop_menu_styles.css" type="text/css" rel="stylesheet"> 


    </head> 
    <body class=" cms-index-index shadow lte-ie8 cms-home"> 
    <div class="nav-container itemgrid itemgrid-6cols"> </div> 
    </div> 
    <div class="middle-product"> 
    <div class="gd-col navUnitContainer gu4 required-tracking" data-tracking-id="vn_clothing"> 
    <div class="title">Games</div> 
    <div class="content"> 
    <img width="212px" height="230px" data-src="#" alt="" src="images/java3.jpg"><!--product image--> 
    </div> 
    <div class="links"> 
    <ul> 
    <li> 
    <a class="active" href="#">GTA</a> 
    </li> 
    <li> 
    <a href="#">WWE</a> 
    </li> 
    <li> 
    <a href="#">fifa 14</a> 
    </li> 
    <li> 
    <a href="#">fifa13</a> 
    </li> 
    <li class="view-all"> 
    <a class="view-all-link" data-tracking-id="1" href="#">View All »</a> 
    </li> 
    </ul> 
    </div> 
    </div> 
    </div> 
    </div> 
    </div> 
    </div> 
    </div> 
    </body> 
    </html> 

그리고 내 세 CSS 파일 귀하의 HTML 코드가 잘되지 않았습니다

.gu4 { 
    width: 234px; 
} 
.navUnitContainer .title { 
    background: url("java3.png") no-repeat scroll right 13px #4B4B4B; 
    bottom: 1px; 
    color: #FF96ff; 
    font-family: Arial; 
    font-size: px; 
    font-weight: bold; 
    left: 1px; 
    opacity: 1; 
    padding: 10px 0 10px 10px; 
    position: absolute; 
    text-transform: uppercase; 
    width: 221px; 
    z-index: 2; 
} 
/*************************************CHANGE TO SLIDE UP********************************** 
.navUnitContainer .content { 
    font-size: 0; 
    height: 216px; 
    line-height: 0; 
}*/ 
.navUnitContainer .content img { 
    border: 1px solid #DEDEDE; 
    height: 212px; 
    left: 0; 
    position: relative; 
    top: 0; 
    width: 230px; 
} 
.navUnitContainer { 
    margin-top: 2px; 
    position: relative; 
} 
.navUnitContainer .links { 
    background-color: rgba(0, 0, 0, 0.7); 
    bottom: 0; 
    height: 147px; 
    left: 0; 
    margin: 0 2px 2px 1px; 
    opacity: 0; 
    padding: 15px; 
    position: absolute; 
    right: 0; 
    top: 0; 
    transition: visibility 0s linear 0.5s, opacity 0.5s linear 0s; 
    visibility: hidden; 
} 
.navUnitContainer .links a { 
    color: #FF96ff; 
    font-size: 13px; 
    font-weight: bold; 
    line-height: 1.5em; 
} 
.navUnitContainer .links a:hover { 
    color: #FFFFFF; 
    text-decoration: underline; 
} 
.navUnitContainer .links .view-all { 
    bottom: 15px; 
    font-weight: bold; 
    margin-top: 10px; 
    opacity: 0; 
    position: absolute; 
} 
.navUnitContainer .links .view-all a { 
    border: 1px solid #FFFFFF; 
    border-radius: 5px 5px 5px 5px; 
    display: inline-block; 
    font-size: 16px; 
    padding: 3px 5px; 
} 
.navUnitContainer .links .view-all a:hover { 
    background-color: #FF96ff; 
    color: #FFFFFF; 
    text-decoration: none; 
} 
.navUnitContainer:hover .links { 
    opacity: 1; 
    transition-delay: 0s;/*************************************DELAY IN SLIDE DOWN******************************/ 
    visibility: visible; 
} 
.navUnitContainer:hover .links .view-all { 
    opacity: 1; 
} 
.navUnitContainer:hover .title { 
    background-color: #FF96ff; 
    color:#FFFFFF 
} 
.navUnitContainer:hover .content img { 
    border: 1px solid #FF96ff; 
    left: 0; 
    top: 0; 
} 
.browser-warn { 
    padding: 10px; 
} 
.browser-warn .logo { 
    background: url("../prod/images/browsers-d9f97dca.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0); 
    display: block; 
    height: 72px; 
    width: 52px; 
} 
.browser-warn .IE { 
    background-position: -51px 0; 
} 
.browser-warn .Firefox { 
    background-position: -107px 0; 
} 
.browser-warn .Safari { 
    background-position: -161px 0; 
} 
.browser-warn .Chrome { 
    background-position: 1px 45px; 
} 

alshop_menu_style.css

@charset "utf-8"; 
.middle-product .links ul li { 
    float: right; 
    text-align: left; 
    width: 100%; 
} 
.middle-product .links ul li a:hover { 
    background-color: #FF96ff !important; 
    text-decoration: underline !important; 
} 
.middle-product { 
    float: center; 
    margin: 10px auto; 
    width: 738px; 
} 

.navUnitContainer { 
    margin: 0 8px 10px; 
    width: 231px !important; 
} 

* { 
    margin: 0; 
    padding: 0; 
} 
html { 
    font-size: 16px; 
} 
body { 
    background-color: #FFFFFF; 
    color: #333333; 
    font: 75%/150% Arial,Helvetica,sans-serif; 
    text-align: center; 
} 
img { 
    border: 0 none; 
    max-width: 100%; 
    vertical-align: top; 
} 
a { 
    color: #888888; 
    text-decoration: none; 
} 
a:hover { 
    color: #CA0413; 
    text-decoration: none; 
} 
:focus { 
    outline: 0 none; 
} 
h1, h2, h3, h4, h5, h6 { 
    margin: 0 0 10px; 
} 
h1 { 
    font-size: 1.75em; 
    font-weight: normal; 
    line-height: 1.25em; 
} 
h2 { 
    font-size: 1.5em; 
    font-weight: normal; 
    line-height: 1.6666em; 
} 
h3 { 
    font-size: 1.25em; 
    font-weight: bold; 
    line-height: 1.2em; 
} 
h4 { 
    font-size: 1.1666em; 
    font-weight: bold; 
} 
h5 { 
    font-size: 1em; 
    font-weight: bold; 
} 
h6 { 
    font-size: 1em; 
    font-weight: bold; 
} 
form { 
    display: inline; 
} 
fieldset { 
    border: 0 none; 
} 
legend { 
    display: none; 
} 
table { 
    border: 0 none; 
    border-collapse: collapse; 
    border-spacing: 0; 
    empty-cells: show; 
    font-size: 100%; 
} 
caption, th, td { 
    font-weight: normal; 
    text-align: left; 
    vertical-align: top; 
} 
strong { 
    font-weight: bold; 
} 
address { 
    font-style: normal; 
} 
cite { 
    font-style: normal; 
} 
q, blockquote { 
    quotes: none; 
} 
q:before, q:after { 
    content: ""; 
} 
small, big { 
    font-size: 1em; 
} 
sup { 
    font-size: 1em; 
    vertical-align: top; 
} 
ul, ol { 
    list-style: none outside none; 
} 
.col-main { 
    float: left; 
} 
.links li a, #mini-cart .block-title, .header .block-compare .block-title { 
    line-height: 2.6666em; 
    padding: 0 0.5833em; 
} 
.links li { 
    float: left; 
} 
.links a { 
    display: block; 
} 
+1

당신이 그것을 검증이 있나요? 나는 그렇지 않다. 해! 오, 여기에 전체 코드를 게시하지 마십시오. 문제의 작은 예를 만드십시오. –

+0

@Layne 유효성을 검사하는 방법은 무엇입니까? – prakash

+1

[w3c 유효성 검사기] (http://validator.w3.org/). Layne이 말했듯이 여기에 모든 코드를 게시하면 도움이되지 않습니다. 무엇이라도 [jsfiddle] (http://jsfiddle.net) – gwillie

답변

0

alshop_menu_styles.css alshop_menu_boc.css 형성되었다. Doctype이 누락되어 일부 사소한 오류가 발생했습니다. 이걸 써봐.

CSS에서 float은 'cneter'일 수 없습니다. 그것은 'right'또는 'left'중 하나입니다.

마지막으로 css에서도 'font-size'의 값은 px입니다. 유효한 값, 예를 들어 '13px'가 있어야합니다.

<head> 
    <title>Insert title here</title> 
    <link media="all" href="alshop_menu_box.css" type="text/css" rel="stylesheet"> 
    <link media="all" href="alshop_menu_style.css" type="text/css" rel="stylesheet"> 
    <link media="all" href="alshop_menu_styles.css" type="text/css" rel="stylesheet"> 
</head> 

<body class=" cms-index-index shadow lte-ie8 cms-home"> 
    <div class="nav-container itemgrid itemgrid-6cols"></div> 
    <div class="middle-product"> 
     <div class="gd-col navUnitContainer gu4 required-tracking" data-tracking-id="vn_clothing"> 
      <div class="title">Games</div> 
      <div class="content"> 
       <img width="212" height="230" data-src="#" alt="" src="images/java3.jpg"> 
       <!--product image--> 
      </div> 
      <div class="links"> 
       <ul> 
        <li> <a class="active" href="#">GTA</a> 

        </li> 
        <li> <a href="#">WWE</a> 

        </li> 
        <li> <a href="#">fifa 14</a> 

        </li> 
        <li> <a href="#">fifa13</a> 

        </li> 
        <li class="view-all"> <a class="view-all-link" data-tracking-id="1" href="#">View All »</a> 

        </li> 
       </ul> 
      </div> 
     </div> 
    </div> 
</body> 

관련 문제