html - 创建具有两种不同颜色的页脚

标签 html css

我正在尝试根据收到的设计创建页脚......

左边的背景颜色和右边的不一样:

Footer

我有以下标记:

<div class"wrapper">
  <div class="content">
    The Text here should no go over the logo
  </div>
</div>

我的想法是 Content DIV,让 Logo 作为背景图像左对齐且不重复。

但后来我不知道如何在左侧和右侧创建不同的颜色......

而且我不确定我是否可以控制高度以使所有内容对齐。

内容 div 居中并且在图像上有橙色边框 ...

谢谢你,
米格尔

最佳答案

试试这个 http://codepen.io/nicknameless/pen/cblzB/

我使用了 CSS3,没有额外的标记。这应该适合你。我认为它可以清理干净,这只是一个快速概述,可以帮助您入门。

您提供的 HTML

<div class="wrapper">
  <div class="content">
    The Text here should no go over the logo
  </div>
</div>

CSS

html, body {
  padding: 0;
  margin: 0;
}
div.wrapper {
  height: 40px;
  background: #850000;
  width: 100%;
  display: block;
  position: relative;
  overflow: visible;
  top: calc( 100px - 40px );
}
div.wrapper:before {
  background: transparent url('http://placehold.it/100x100') no-repeat 0 0;
  content: " ";
  width: 100px;
  height: 100px;
  position: absolute;
  bottom: 0;
  left: 10%;
}
div.content {
  left: calc( 10% + 100px );
  padding-left: 10px;
  bottom: 0;
  background-color: #C70000;
  display: block;
  height: 40px;
  position: absolute;
  width: calc( 100% - ( 10% + 100px ) );
}

关于html - 创建具有两种不同颜色的页脚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22947823/

相关文章:

php - 如何让 <table> 居中?

html - 在 Bootstrap 网格中制作一个粘性 div

html - 如何让并排放置的两个div居中

html - 行内 block 不在一行中

css - LESS 转义不起作用

CSS 变量 child-height 取决于 parent-height

css - 如何调整任何屏幕尺寸的 div 和内容?

javascript - 我应该在页面加载时将预加载器图像放在哪里?

javascript - 为什么当我向下移动文本时,浏览器内部会出现另一个垂直滚动条?

jquery 更改 css 点击