2013-08-26 10 views
0

현재 간단한 사이트를 만드는 중입니다.배경 이미지가 표시되지 않습니다.

배경 이미지를 만들려고 할 때 표시되지 않습니다. 필자는 맵핑이 잘못되었는지 확인하기 위해 정상적인 이미지에만 동일한 매핑을 사용했습니다.

이 내 현재 코드입니다 :

<body> 
<table> 
<!-- multiple <trs><tds><divs></divs></tds></trs> --> 
</table> 
</body> 

내 CSS는 다음과 같습니다

* { 
    padding:0; margin:0; 
} 

html, body { 
    height:100%; 
    width: 100%; 
} 

body{ 
    background: transparent url('./img/background.jpg') no-repeat 0 center; 
    display: inline-block; 
} 

편집 :

background: transparent url('../img/background.jpg') no-repeat 0 center; 

: 나는 그것을 변경했습니다

그것은 효과가 있었지만, 필요 ./

background-image: transparent url('../img/background.jpg') no-repeat 0 center; 
+1

'body {display : inline-block;}'? 진심으로? –

+0

@ Mr.Alien 나는이 문제를 약 30 분 동안 봤는데, 거의 모든 스레드가 display : block; 또는 디스플레이 : 인라인 블록; 그것을 해결하기 위해. 나는 그것을 막 제거하지 않았다. – nlreturns

+0

'body'는 기본적으로 블럭 레벨 요소입니다.'inline-block'으로하지 마십시오. –

답변

0
Change this code 

background: transparent url('./img/background.jpg') no-repeat 0 center; 

and write like this 

background: transparent url('../img/background.jpg') no-repeat 0 center; 
0

이 시도 .. 노력 중이 야.

+0

이 마법은 무엇입니까? 그것은 나에게 똑바로 보지 않는다. 그것은 directoy 이전에 위치한 아니에요 + 전에도 이것을 시도! 하지만 고마워 지금은 .. 이상한. – nlreturns

+0

@JanwillemDooms 그게 지금은 .. –

+0

좋아 .. 이상하게도 내가 페이지를 새로 고침했을 때, 배경은 사라졌다. 코드는 동일하게 유지되었다. CSS는 정말 프로그래머에게 정신이 없다 .. – nlreturns

0

이 늘

0

중 하나 ../img/background.jpg 또는 img/background.jpg에 의해 ./img/background.jpg' 교체 작업을 다른 ../하도록 변경 : 전자 페이지가 다시, 그것은

관련 문제