html -- background

css – background

css – background

背景使用蓝色, 前景使用黄色 (前景就是字体)

p {
    background-color: navy;
    color: yellow;
}

背景图片无法显示的时候或者图片中有透明的部分时, 颜色才会被看见

p {
    background-image: url(/home/USER/Pictures/a.png);
}
p {
    background-image: url(/home/USER/Pictures/beautiful/xxxx.jpg);
    color: red;
    background-color: green;
    background-repeat: no-repeat;      # 不要重复
    background-size: cover;            # 完全填满背景区
}
p {
    background-image: url(/home/USER/Pictures/xxxx.jpg);
    color: red;
    background-color: green;
    background-attachment: fixed;   # 固定在页面, 不随着页面的滚动而滚动
}
background-postition: 50px 50px;
background-postition: center;      # 只设定一个, 相当于设定了第二个为 center
background-position: 0 100px;
时间: 2024-08-01 03:31:29

html -- background的相关文章

Android的ImageView中的android:src和android:background的区别

http://www.androidren.com/index.php?qa=301&qa_1=android的imageview中的android-src和android-background的区别 有下面几个不同点: 1.src是前景foreground.background是后景background. 2.src是显示内容,background是背景. 3.background是所有view都有的属性,而src是ImageView特有的,它会受到android:scaleType的影响,而

androidannotations的background和UiThread配合使用参考

简介 androidannotations在开发中的代码规范思考:(MVC思考)时间太紧,先贴代码: Activity的代码: package edu.njupt.zhb.main; import org.androidannotations.annotations.AfterViews; import org.androidannotations.annotations.Bean; import org.androidannotations.annotations.EActivity; imp

Bg, Fg, &, Ctrl-Z – 5 Examples to Manage Unix Background Jobs

When you execute a unix shell-script or command that takes a long time, you can run it as a background job. In this article, let us review how to execute a job in the background, bring a job to the foreground, view all background jobs, and kill a bac

有关background 背景图片不能显示

首先有两个概念 绝对路径,从根目录为起点到你所在的目录: 相对路径,从一个目录为起点到你所在的目录. 例如:              ┍ A文件夹           C -|              ┕ B文件夹 绝对路径: C:\A文件夹 相对路径(如果你在B文件夹时): ..\B文件夹  ('..\'向上一级意思) 在实际操作过程中,相对地址和css是内联还是外联有关系的,这个问题在使用绝对地址时不存在. 内联时:{background-image: url(images/new_8.

[SVG] Add an SVG as a Background Image

Learn how to set an SVG as the background image of an element. Background images can be resized by changing the width and height of the element containing background image, so it’s easy to create multiple sizes of the same icon. However, each backgro

[SVG] Add an SVG as an Embedded Background Image

Learn how to set an elements background image to embedded SVG. This method has an added benefit of not incurring any HTTP requests, as the SVG is simply embedded into the CSS. They can also be resized by changing the width and height of the element c

理解CSS3中的background-size(对响应性图片等比例缩放)

2016-03-10 01:40 by 空智, 7463 阅读, 8 评论, 收藏, 编辑 阅读目录 background-size的基本属性 给图片设置固定的宽度和高度的 固定宽度400px和高度200px-使用background-size:400px 200px缩放设置 固定宽度400px和高度200px-使用background-size:400px;的缩放设置,那么第二个参数会自动转换为auto 固定宽度400px和高度200px-使用background-size:100% 100%

CSS中background:url(图片) 不能显示的问题

刚刚碰到一个奇怪的问题,这样一段CSS代码: 1 .pho6 { background: url(img/pho6.jpg);  } 这段代码居然不能显示出背景图片,路经绝对是没错的代码肯定没有问题,俄,百度了好久终于让我给找到了真正的问题在哪? 在url(imagepath)里的这个imagepath(图片路径).原来它是相对于.css文件所在的文件夹,也就是调用css文件夹下的子文件夹来获取路径地址, 通过浏览器调试,可以看到浏览器获取路径是从css下面的img来找我的图片的,但是 我的im

CSS背景属性background

background属性是所有背景属性的缩写: 以下是这些背景属性: background-color:背景颜色 你可以通过颜色名称(red/green/blue)来设置 也可以用十六进制(#fff/#000/#bcbcbc) 还可以用到rgb(x,x,x)  x取值(0~255) background-position:背景开始位置 也是三种取值方式,第一种是用方位词(top/right/bottom/left)组合,如left top 百分比x%  x%,如0% 0%表示左上角 用像素表示,

1 background(复合属性)与font(复合属性) 2 行内块的间距问题 3 行内元素的margin 4 清除浮动 5定位的元素的层级 6 Border-radius: 边框半径

1 background(复合属性)与font(复合属性): background: 颜色  图片的链接  是否平铺  背景位置 是否滚动.(可以随意调动或省略) Font: 粗度 字体风格 字体大小/行高 字体样式 字体大小和样式不可省略 2 行内块的间距问题 行内块元素相邻时,行内块元素之间会有几像素的间距,只有通过浮动解决. 3 行内元素的margin 行内元素的上下外边距不起作用,左右起作用. 4 清除浮动 给父盒子设置一个高度     Clear: both      Overflow