2013-03-15 75 views
0

我不是一個真正的冠軍,當涉及到CSS,所以我希望我能得到一些幫助。的DIV在父DIV重疊時調整

現在我有一個父格有兩個孩子的div。目前,無論何時調整瀏覽器大小,兩個div都相互重疊。我希望左邊的div始終可見。

它可以在行動被視爲在這裏:http://unlimitedbrettworks.com/forums/

CSS:

#header { 
    position: relative; 
    height: 140px; 
    overflow: hidden; 
    background-color: #E1E1E1; } 
#logo a { 
    overflow: hidden; 
    float: right; 
    width: 620px !important; 
    height: 190px !important; 
    cursor: pointer; 
    background: url(../images/art/logo.png) no-repeat; 
} 
#userarea { 
    float: left; 
    margin: 0 1em; 
    padding: 1.5em 1em 0 1em; 
    text-align: left; 
    font-size: 0.95em; 
    width: 38em; 
    color: #313131; 
    font-family: tahoma, sans-serif; 
    line-height: 130%; 
} 
#userarea a:link, #userarea a:visited { 
    color: #333333; 
} 
#userarea a:hover { 
    color: #800000; 
    text-decoration: underline; 
} 
+0

只是有點建議下次,總是使用靜態容器。它是一個固定寬度(比較喜歡960像素)的網站容器,所以網站總是960像素,你的屏幕有多大或多小。 – 2013-03-15 10:44:45

+0

謝謝你的建議。事情是,我沒有創建這個論壇風格。我只是編輯東西。 – KazukiMutou 2013-03-15 10:51:16

回答

0
#header { 
    position: relative; 
    height: 140px; 
    overflow: hidden; 
    background-color: #E1E1E1; } 
#logo a { 
    overflow: hidden; 
    float: right; 
    width: 620px !important; 
    height: 190px !important; 
    cursor: pointer; 
    background: url(../images/art/logo.png) no-repeat; 
} 
#userarea { 
    float: left; 
    margin: 0 1em; 
    padding: 1.5em 1em 0 1em; 
    text-align: left; 
    font-size: 0.95em; 
    width: 38em; 
    color: #313131; 
    font-family: tahoma, sans-serif; 
    line-height: 130%; 
    height: 122px; /* is value is the height min the padding you use.*/ 
} 
#userarea a:link, #userarea a:visited { 
    color: #333333; 
} 
#userarea a:hover { 
    color: #800000; 
    text-decoration: underline; 
} 

這是第一個問題。第二個是你的css文件中的第128行。

div#wrapper 
{ 
    margin: 0 auto; 
    min-width: 764px; 
    max-width: 2300px; 
    border: 10px solid #333333; 
} 

需要的是:

div#wrapper 
{ 
    margin: 0 auto; 
    min-width: 1024px; 
    max-width: 2300px; 
    border: 10px solid #333333; 
} 
+0

編輯CSS。現在,當我調整瀏覽器大小時,徽標完全消失。 – KazukiMutou 2013-03-15 10:49:12

+0

是的,你說過「我希望左邊的div始終可見」。如果標識沒有足夠的位置,你想要做什麼? – 2013-03-15 10:57:47

+0

爲您的第二個問題發佈瞭解決方案。這將有所幫助;) – 2013-03-15 11:01:26

0

我去你的網站,並與Chrome的督察出場,並找到了答案。

嘗試增加這些屬性#userarea:

#userarea { 
    position: absolute; 
    background-color: #E1E1E1; 
    height: 100%; 
} 

希望這有助於

+0

這錯誤地對齊了userarea中的所有文本。 – KazukiMutou 2013-03-15 10:48:41

+0

奇怪的是,它在Chrome上適合我。 http://jsfiddle.net/DVpzp/出於好奇,你使用了什麼瀏覽器? – haejeong87 2013-03-15 12:57:21

0

對不起,我沒有得到你的問題......在你的網頁鏈接的#userarea格始終可見即使您調整了窗口大小。

要看到#logo DIV完全,請從父DIV的#header的「高度」屬性,它會在新行如果窗口不夠大。