2012-07-30 2 views
0

편집 : 내가 한 일은 내가 아래에 쓴 것과는 다르지만 지금은 작동합니다. 왜 그런지 모르겠다 : - 도움을 주신 분들께 :HTML CSS - 폴더가 없으면 작동하지 않습니다

내 문서를 CSS 파일에 연결하려고합니다. 문제는 그것입니다.

이 작동 :

<link rel="stylesheet" type="text/css" href="style.css"> 

이것은 dosent : 내가 여기에 연결하려고 할 때

<link rel="stylesheet" type="text/css" href="css/style.css"> 

그리고 물론 파일

가 하위 폴더에 존재한다.

:

편집 :

HTML 파일은 내 HTML 편집기 (Expression Web을)에서만 작동하지만 보인다

<link rel="stylesheet" type="text/css" href="/css/style.css"> 
</head> 
<body> 
<table id="menu"> 
<tr> 
<td><a id="button">Home</a></td> 
<td><a id="button">Education</a></td> 
<td><a id="button">Experience</a></td> 
<td><a id="button">Gallery</a></td> 
<td><a id="button">Cantact Me</a></td></tr> 

</table> 

난 (브라우저에서 크롬/파이어 폭스를 열 때/ie) 그것은 작동하지 않습니다.

스타일 파일 :

body{ background-color: white;} 

#menu { width:100%; background-image:url('BarBG.png'); border:0px; } 
#button 
{ 
color:white; 
font-size:large; 
line-height:45px; 
vertical-align:middle; 
text-align:center; 
display: block; 
width: 100px; 
height: 45px; 
margin-right:auto; 
margin-left:auto; 
    } 
    #button:hover{ 


color:black; 
font-size:large; 
line-height:45px; 
vertical-align:middle; 
text-align:center; 
display: block; 
width: 100px; 
height: 45px; 
margin-right:auto; 
margin-left:auto; 
background-image:url('BarBGHover2.png'); 
cursor:pointer; 
} 
+0

사이트의 디렉토리 구조는 무엇입니까? HTML 파일은 어디에 있습니까? 우리는 추측 할 수 있지만,이 질문은 더 많은 정보 없이는 현실적으로 대답 할 수 없습니다. –

답변

1

트레이는 다른 방법이 시도 루트

<link rel="stylesheet" type="text/css" href="/css/style.css"> 
+0

그것이 효과가 있었지만 어떤 이유로 이제 테이블의 텍스트가 중간/중앙 대신 왼쪽으로 정렬됩니다. –

+0

어떻게 작동했는지 어떻게 알 수 있습니까? –

+0

@Xirox는 모두 CSS 파일이 동일합니까? 보벡 (bobek)이 묻는 것처럼, 어떻게 작동하는지 아십니까? HTML에 정렬 코드를 무시하는 인라인 CSS가 있습니까? 문제의 코드 스 니펫을 게시하면 더 도움이 될 수 있습니다. – Sam

0

에 대한 링크 상대적인을 다음 ./가 호출되는 위치에서 상대적인 의미

<link rel="stylesheet" type="text/css" href="./css/style.css"> 

에서. 항상 필요한 것은 아니지만 때로 도움이 될 수 있습니다. :)

관련 문제