嗨朋友有没有可能得到像这样的双色背景100%的宽度和高度
这是示例图像:
示例图片http://www.mediaserveit.com/demo/vivek/resources/question.png
(样品)左手边的白色其余部分是其他颜色.
如果我用div的方法
.left{
float:left;
width:30%;
background-color:#fff;
}
.right{
float:right;
width:70%;
background-color:#B97A57;
}
Run Code Online (Sandbox Code Playgroud)
这使得高度问题.增加取决于div的内容.如果我使用min-height意味着它也在不同的屏幕上更改.如果有任何黑客在html体内设置像这样的背景!因为我需要全屏
使用渐变作为背景.
body{
background: #fcfcfc; /* Old browsers */
background: -moz-linear-gradient(left, #fcfcfc 30%, #6b1717 30%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(30%,#fcfcfc), color-stop(30%,#6b1717)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, #fcfcfc 30%,#6b1717 30%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, #fcfcfc 30%,#6b1717 30%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, #fcfcfc 30%,#6b1717 30%); /* IE10+ */
background: linear-gradient(to right, #fcfcfc 30%,#6b1717 30%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcfcfc', endColorstr='#6b1717',GradientType=1 ); /* IE6-9 */
}
Run Code Online (Sandbox Code Playgroud)
使用以下内容生成渐变:http://www.colorzilla.com/gradient-editor/