我正在尝试将我的网站切换到CSS格式,除了我的页面布局有两个问题外,它看起来还不错:
1)我最左边一列的背景图片没有重复(虽然背景颜色延伸了整个页面的长度)和
2)我的版权页脚显示在我的两个布局列的右侧而不是底部。我已经尝试了所有可以找到的建议,但我对这两个问题都没有运气!
页面和代码可以在这里看到: http://agdequine.com/About_Adam.html
(计划最终取消目前主要部分中的布局表,但一次只能做一件事!)
谢谢!
答案 0 :(得分:0)
http://codepen.io/anon/pen/lpDKs
绝不应使用这些表来对齐内容。 仅使用浮子,没有绝对定位。 重复背景位于主容器上,其最小高度为100%。
注意:它仍然需要做很多工作。但这是一个粗略的想法。
html,body {
height: 100%;
margin: 0;
padding: 0;
}
body {
background-color:#597d4f;
}
.container {
position: relative;
width: 850px;
margin:0 auto;
overflow: auto;
min-height: 100%;
background-color:#597d4f;
background-image:url('http://agdequine.com/images/banner_top_02.jpg');
background-repeat:repeat-y;
background-origin:border-box;
}
.topframe {
position: relative;
height: 323px;
background-color:#597d4f;
background-image:url('http://agdequine.com/images/banner_top_01.jpg');
background-repeat:no-repeat;
background-origin:border-box;
}
.leftframe {
width:196px;
float: left;
}
.mainframe {
width: 654px;
float: left;
background-color:#faf4d1;
padding-bottom: 80px;
}
.title_main {
font-size: 46px;
font-variant:small-caps;
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
color:#6f4e4a;
font-style: italic;
padding-left: 30px;
padding-top: 30px;
}
.nav_container {
width: 196px;
height: 190px;
position: relative;
margin-top: 5px;
background: rgba(167,192,74,0.4);
}
.footer {
position: relative;
width: 850px;
margin: -80px auto 0 auto;
clear: both;
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
font-size: 12px;
color: #4e3d41;
}
.footer p {
text-align: right;
}
ul.nav {
list-style-type: none;
}
a.menuitem {
text-decoration: none;
font-variant:small-caps;
font-size: 24px;
}
a.menuitem:link {color:#6f4e4a;}
a.menuitem:visited {color:#6f4e4a;}
a.menuitem:hover {text-decoration: underline;
}
a.main:link {color:#6f4e4a;}
a.main:visited {color:#4e3d41;}
a.main:hover {color:#FF0000;}
.image-cont {
width:200px;
position:relative;
}
.img-left {
float: left;
margin: 10px 10px 10px 0;
}
.img-right {
float: right;
margin: 10px 0 10px 10px;
}
p.main {
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
font-size: 14px;
color:#4e3d41;
}
p.largemain {
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
font-size: 16px;
color:#4e3d41;
}
p.caption {
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
font-size: 12px;
color:#4e3d41;
}
.emphasize {
color:#FF0000;
font-weight: bold;
}
答案 1 :(得分:-1)
背景定位的正确sintax没有值之间的-
:
background-position: top left;
然后,由于您将定位设置为绝对值,因此图像不会垂直延伸,因此如果您将高度定义为百分比,则它将与内容本身一样高,而不是父容器。