用background 显示背景图的部分
2011-06-07 14:19
288 查看
<!DOCTYPE html>
<html>
<head>
<style>
body{margin:0;}
div{
width:200px;
height:100px;
margin:5px;
border:1px solid red;
background-image:url( http://www.google.com.hk/intl/zh-CN/images/logo_cn.png);
}
#div1{
background-position:left bottom;
}
#div2{
background-position:right top;
}
</style>
</head>
</body>
<div></div>
<div id="div1"></div>
<div id="div2"></div>
</body>
</html>
但是要求:
1:需要北京图片非常大
2:图片不能是透明的
<html>
<head>
<style>
body{margin:0;}
div{
width:200px;
height:100px;
margin:5px;
border:1px solid red;
background-image:url( http://www.google.com.hk/intl/zh-CN/images/logo_cn.png);
}
#div1{
background-position:left bottom;
}
#div2{
background-position:right top;
}
</style>
</head>
</body>
<div></div>
<div id="div1"></div>
<div id="div2"></div>
</body>
</html>
但是要求:
1:需要北京图片非常大
2:图片不能是透明的
相关文章推荐
- background属性(显示背景图片中间部分)
- IE下background背景图片无法显示问题解决方法
- android--设置TextView部分文字的颜色和背景(高亮显示)
- CSS 背景图片始终显示最中间的部分,不随窗口变化而收缩或变形。
- [转]外部css文件中的 BACKGROUND-IMAGE: url(../image.gif)指定的背景图像无法显示,谁有好主意?
- android--设置TextView部分文字的颜色和背景(高亮显示)
- background:url() 背景图不显示
- background图片背景在IE下显示失败
- ie8 background背景图片不显示问题
- Echarts插件的所有显示方式设置 theme = { // 全图默认背景 // backgroundColor: ‘rgba(0,0,0,0)’,
- background 背景图片 在IE8中不显示解决方法
- background-image中url找不到路径,背景图像无法显示
- CSS样式中,background-image 背景图片如何居中显示
- HTML遮罩层,背景半透明,只显示中间部分
- 最新历史版本 :android--设置TextView部分文字的颜色和背景(高亮显示)
- android--设置TextView部分文字的颜色和背景(高亮显示)
- 适配:EditText背景在部分手机上显示黑色
- 最新历史版本 :android--设置TextView部分文字的颜色和背景(高亮显示)
- IE下background背景图片无法显示问题解决方法
- 控件调用setBackgroundResource,背景是XML文件时不显示