2012-07-18 3 views

답변

2

시도 :

#parent { 
overflow: hidden; 
text-align:center; 
margin:auto; 
width:80%; 
} 
.navbar { 
position:absolute; 
top:0px; 
right:3px; 
} 
.logo { 
float:left; 
} 
.table { 
float:left; 
} 

#parent { 
    overflow: hidden; 
text-align:center; 
} 
.navbar { 
position:absolute; 
top:0px; 
right:3px; 
} 
.logo { 
float:left; 
} 
.table { 
float:left; 
} 

하지만 나를 위해 작동하지 않습니다,이 얻을 원하는 결과를 얻으려면 margin:auto을 사용하여 상위 구분선을 가운데에 배치하고 width:80%을 사용하여 유체 너비를 배치해야합니다.

+0

안녕하세요, 이것은 테이블과 로고에서 작동하지만 navbar가 표와 일치하지 않습니다. –

+0

일부 HTML을 보여줘야합니다. –

+0

본문으로 해결했습니다. {margin : 0 0 0 0; }, 당신의 도움을 주셔서 감사합니다! –

1

나는 명시적인 폭, 다음 위치 거기에서 당신의 부모 요소를 줘야 할 것 : 난 당신이 페이지에있는 다른 어떤 내용을 모르는

#parent { 
    width: 960px; 
    margin: 0 auto; 
    position: relative; 
} 

.navbar { 
    position: absolute; 
    top: 0; 
    right: 3px; 
} 

.logo { 
    margin-bottom: 20px; 
    display: inline-block; 
} 

.table { 
    width: 100%; 
} 

하지만 .logo는 요소 이 나타납니다 기본 HTML 흐름을 사용하려는 곳. 표가 100 %이면 삭제됩니다. 당신은 부유물없이 이것을 꺼낼 수 있어야합니다.