gpt4 book ai didi

css双色背景hack

转载 作者:行者123 更新时间:2023-12-02 04:56:31 30 4
gpt4 key购买 nike

嗨 friend 们有没有可能得到像这样的双色背景作为 100% 的宽度和高度

这是示例图片:

Sample Image 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;
}

这造成了高度问题。它的增加取决于 div 上的内容。如果我使用最小高度意味着它在不同的屏幕上也会发生变化。如果有任何 hack 可以在 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 */
}

梯度生成使用:http://www.colorzilla.com/gradient-editor/

演示:http://jsfiddle.net/guE5L/

关于css双色背景hack,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17897545/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com