Home Web Front-end CSS Tutorial Summary and sharing of background (properties, colors, pictures) settings in css

Summary and sharing of background (properties, colors, pictures) settings in css

Jun 01, 2017 pm 01:43 PM

This article is about some common sense about css background. It introduces css background properties, css background color, and css background image in detail. Friends in need can refer to

1. css background properties

1. CSS background property and CSS3 background image settings Summary sharing

In css, there are several background attributes as follows.

background    在一个声明中设置所有的背景属性。
background-attachment    设置背景图像是否固定或者随着页面的其余部分滚动。    
background-color    设置元素的背景颜色。 
background-image    设置元素的背景图像。
background-position    设置背景图像的开始位置。
background-repeat    设置是否及如何重复背景图像。   
background-clip    规定背景的绘制区域。
background-origin    规定背景图片的定位区域。
background-size    规定背景图片的尺寸。
Copy after login

2. Must master CSS knowledge-background property

Note: background-color cannot be inherited, and its default value is transparent. Transparent means "transparent". That is, if an element does not specify a background color, the background is transparent so that the background of its ancestor elements is visible.

3. css background fixed style background-attachment attribute basic introduction

Summary and sharing of background (properties, colors, pictures) settings in css

The background-attachment attribute has only 2 attribute values. scroll means that the background image scrolls as the object scrolls, which is the default option; fixed means that the background image is fixed on the page, and only other content scrolls with the scroll bar.

2. css background color

1. Use CSS to cleverly create background color gradient animation examples

The text starts here. Sometimes, well, it should be said that in some specific occasions, we may need the following animation effect, gradient + animation:

Summary and sharing of background (properties, colors, pictures) settings in css

2. Use css3 to implement the background Gradient method

Before I didn’t understand that CSS could also be used to make background gradients, I always used PS to apply background gradient pictures to the web pages I created. However, not long ago, I learned that CSS3 can also do background gradients, and it has become much easier to achieve background gradient effects. Here are some methods of doing background gradients in CSS3

3. CSS3 An example of using RGBa to adjust transparency in

In CSS3, an opacity attribute is added to allow developers to set the transparency of elements. Now opacity has been supported by mainstream modern browsers, but opacity will Setting the set element and its sub-elements to the same transparency at the same time is quite inflexible and often causes a lot of trouble in actual development. In fact, there is another color transparency solution in CSS3 - RGBa. Compared with opacity, RGBa can set transparency on a single element without affecting its sub-elements. However, RGBa's browser support is not as extensive as opacity, so it has attracted relatively little attention from developers.

3. css background image

1. CSS implements responsive full-screen background image

Summary and sharing of background (properties, colors, pictures) settings in css

A very popular web page format currently is full-screen large images. This article will use the simplest way to achieve this effect. The CSS property background-size is used, no javascript is required.

2. Detailed explanation about CSS3 multiple backgrounds and background image cropping, positioning and size

Summary and sharing of background (properties, colors, pictures) settings in css

Before CSS3 we could edit the background Add an image. CSS3 allows us to add multiple images to an element. Multiple backgrounds can add multiple image resources to the background attribute, separated by commas

and then use background-position to position them. The position you want

3. CSS full-screen background image setting django loading image path detailed description

This article introduces the css full-screen background image setting django loading image path The detailed explanation is very good, and I would like to give it as a reference for everyone.

4. Introducing two special effect codes that use CSS to achieve transparent background images and opaque text

Method 1 (frosted glass effect): background image + pseudo class + flite: blur(3px)

Method 2 (semi-transparent effect): background image + positioning + background:rgba(255,255,255,0.3)

CSS two methods to achieve transparent background image and opaque text effect

In projects, it is often used to put some text introduction on the background image. Here are two techniques to achieve transparent background images and opaque text effects. Record them for future learning.

Summary and sharing of background (properties, colors, pictures) settings in cssSummary and sharing of background (properties, colors, pictures) settings in css

Questions and answers related to the background attribute in css

1. css3 - css How to write css so that the background color does not fill the border?

2. css3 - How to make the height of css background image 100% and the width maintain proportion?

3. css3 - css background adaptive problem

4. css3 - How to make the webpage CSS background image Gaussian blurred and display it in full screen

【Related recommendations】

1. Free css online video tutorial

2. php.cn Dugu Jiujian (2) -css video tutorial

3. Learn CSS video tutorial css background at your fingertips

The above is the detailed content of Summary and sharing of background (properties, colors, pictures) settings in css. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

The Roles of HTML, CSS, and JavaScript: Core Responsibilities The Roles of HTML, CSS, and JavaScript: Core Responsibilities Apr 08, 2025 pm 07:05 PM

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

How to use bootstrap in vue How to use bootstrap in vue Apr 07, 2025 pm 11:33 PM

Using Bootstrap in Vue.js is divided into five steps: Install Bootstrap. Import Bootstrap in main.js. Use the Bootstrap component directly in the template. Optional: Custom style. Optional: Use plug-ins.

How to write split lines on bootstrap How to write split lines on bootstrap Apr 07, 2025 pm 03:12 PM

There are two ways to create a Bootstrap split line: using the tag, which creates a horizontal split line. Use the CSS border property to create custom style split lines.

How to resize bootstrap How to resize bootstrap Apr 07, 2025 pm 03:18 PM

To adjust the size of elements in Bootstrap, you can use the dimension class, which includes: adjusting width: .col-, .w-, .mw-adjust height: .h-, .min-h-, .max-h-

Understanding HTML, CSS, and JavaScript: A Beginner's Guide Understanding HTML, CSS, and JavaScript: A Beginner's Guide Apr 12, 2025 am 12:02 AM

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

How to set up the framework for bootstrap How to set up the framework for bootstrap Apr 07, 2025 pm 03:27 PM

To set up the Bootstrap framework, you need to follow these steps: 1. Reference the Bootstrap file via CDN; 2. Download and host the file on your own server; 3. Include the Bootstrap file in HTML; 4. Compile Sass/Less as needed; 5. Import a custom file (optional). Once setup is complete, you can use Bootstrap's grid systems, components, and styles to create responsive websites and applications.

How to insert pictures on bootstrap How to insert pictures on bootstrap Apr 07, 2025 pm 03:30 PM

There are several ways to insert images in Bootstrap: insert images directly, using the HTML img tag. With the Bootstrap image component, you can provide responsive images and more styles. Set the image size, use the img-fluid class to make the image adaptable. Set the border, using the img-bordered class. Set the rounded corners and use the img-rounded class. Set the shadow, use the shadow class. Resize and position the image, using CSS style. Using the background image, use the background-image CSS property.

How to use bootstrap button How to use bootstrap button Apr 07, 2025 pm 03:09 PM

How to use the Bootstrap button? Introduce Bootstrap CSS to create button elements and add Bootstrap button class to add button text

See all articles