我遇到问题让我的容器关闭所以在我做了这个标记我的标题之后我想在下面添加其他项目而不是容器的一部分 - 如果这是有意义的。 我不知道为什么不这样,但这个CSS没有关闭,它基本上只是让它下面的一切都是同一个CSS的一部分
CSS:
.menuButton {
background-color: #8dd1c5;
width: 252px;
height: 52px;
position: absolute;
left: 0;
top: 198px;
z-index: 1000;
display: block;
margin-left: -30px;
margin-top: 17px;
text-decoration: none;
}
user agent stylesheeta:-webkit-any-link {
color: -webkit-link;
text-decoration: underline;
cursor: auto;
}
.menuContainer .menuWrap {
width: 222px;
height: 100%;
overflow: hidden;
position: relative;
-moz-box-shadow: 2px 0 5px 0 rgba(0, 0, 0, 0.5);
-webkit-box-shadow: 2px 0 5px 0 rgba(0, 0, 0, 0.5);
box-shadow: 2px 0 5px 0 rgba(0, 0, 0, 0.5);
}
#pusher {
width: 100%;
position: absolute;
}
.pagesContainer .pageContainer {
display: block;
position: absolute;
height: auto;
bottom: 0;
top: 0;
left: 0;
overflow: hidden;
min-width: 770px;
min-height: 570px;
}
.pagesContainer .pageContainer .pageBackgroundContainer {
display: block;
position: absolute;
height: auto;
bottom: 0;
top: 0;
left: 0;
right: 0;
padding: 30px;
overflow: hidden;
}
.hiddenPageButton, .hiddenMenuButton {
top: 228px;
display: none;
width: auto;
margin-left: 0;
padding-left: 20px;
}
.pagesContainer .pageContainer .topBorderText,
.pagesContainer .pageContainer .bottomBorderText {
position: absolute;
margin: 0 auto;
display: block;
top: 0;
left: 50%;
width: 600px;
margin-left: -300px;
z-index: 2000;
}
.pagesContainer .pageContainer .bottomBorderText {
bottom: 0;
top: auto;
}
.pagesContainer .pageContainer {
display: block;
position: absolute;
height: auto;
bottom: 0;
top: 0;
left: 0;
right: 0;
overflow: hidden;
min-width: 770px;
min-height: 570px;
}
html {
position: relative;
height: 100%;
min-width: 1600px;
min-height: 570px;
}
.menuContainer {
min-height: 510px;
width: 222px;
position: fixed;
top: 0;
bottom: 0;
height: auto;
z-index: 3000;
-webkit-perspective: 1000;
-webkit-backface-visibility: hidden;
}
html:
http://pastebin.com/raw.php?i=g0STLR3u
问题是容器占据了整个页面我只想要它占据顶部标题部分。
请帮忙!
答案 0 :(得分:0)
请加右:0和顶部:0
<h2>
<b style="position: absolute; right: 0px; top: 0px;">
EXPRESSION ON TUMBLR
</b>
</h2>
答案 1 :(得分:0)
我认为你想创建像 Fiddle Link
这样的菜单我已经使用了<ul>
和<li>
,请查看:
HTML:
<div class="menuButton">
<ul>
<li>Navigation</li>
<li>Home</li>
<li>About</li>
<li>Contact</li>
<li>Credit</li>
</ul>
</div>
CSS:
.menuButton ul li{
display: inline;
list-style-type: none;
padding-left: 20px;
}
.menuButton {
background-color: #8dd1c5;
width: 500px;
height: 52px;
position: absolute;
left: 0;
top: 198px;
z-index: 1000;
display: block;
margin-left: -30px;
margin-top: 17px;
text-decoration: none;
}
修改强>
将min-height: 570px
更改为min-height: 100%
,如下所示:
.pagesContainer .pageContainer {
display: block;
position: absolute;
height: auto;
bottom: 0;
top: 0;
left: 0;
overflow: hidden;
min-width: 770px;
min-height: 100%;
}