html - CSS 边框 - 如何用边框填充 div 内的内容

标签 html css

我有 this :

现在,我想要两件事... 左 div(导航)我想要一直到底部的边框。 其次,我想要#content div 中的内容,页脚必须在它之后。

为什么内容一直到内容和页脚?

谢谢。

编辑:

CSS:

 #header { padding: 0px; color: #000; background: #fff;}
  #topnav { color: #aaa; background: transparent; position: inherit;}
  #main { margin: 10px 0; background: #fff;  height: 50%;}
  #footer { padding: 10px 0px 10px 0px; margin-top: 25px; color:#666; background: #f9f9f9; border-top: 5px #efefef solid; }

  #col1 { float: left; width: 13%;}
  #col2 { display:none}
  #col3 { width: auto; margin: 0 0 0 15%}
  #col1_content { padding: 0 10px 0 20px;}
  #col3_content { padding: 0 20px 0 10px;}
  #col1 { border-right: 5px #ddd ridge }

最佳答案

将您的页脚放置在绝对位置,这样它就可以像所有页脚一样固定在最底部,除非您有不同的想法。

#footer { position:absolute; bottom: 0px; left: 0px; }

关于html - CSS 边框 - 如何用边框填充 div 内的内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11901857/

相关文章:

html - 为父内容添加子宽度

javascript - 交叉悬停效果 - 第二个背景没有响应

html - 100% 高度和填充 = 溢出

jquery - 网站在 safari 中以较小的屏幕尺寸不断闪烁

javascript - 我无法让我的 jquery 选项卡调用任何 .tab 元素

jquery - 网页动态生成下拉?

CSS:在 CSS 中设置背景图像

html溢出问题

当在 Unix 系统中给出完整的 Web 路径时,PHP move_uploaded_file 不上传图像

html - 在这种情况下如何正确地将两列放在一行中