Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the Grid background in CSS3

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to achieve the grid background in CSS3", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn how to achieve the grid background in CSS3 "this article.

What should be done to implement a grid background with pure css3?

You need to set the background-image,background-size property for the container

. Container {

Background-image: linear-gradient (90deg, rgba (200,0,0,0.15) 10%, rgba (0,0,0,0) 10%, linear-gradient (rgba (200,0,0,0.15) 10%, rgba (0,0,0,0) 10%)

Background-size: 10px 10px

Width: 600px

Height: 300px

}

The background-image attribute sets the background image for the element.

The background of the element occupies the full size of the element, including the inner margin and the border, but not the outer margin.

By default, the background image is located in the upper-left corner of the element and repeats horizontally and vertically.

Background-size specifies the size of the background image

The general values are:

Background-size: length | percentage | cover | contain

Length: sets the height and width of the background image.

The first value sets the width and the second value sets the height.

If only one value is set, the second value is set to "auto".

Percentage: sets the width and height of the background image as a percentage of the parent element.

The first value sets the width and the second value sets the height.

If only one value is set, the second value is set to "auto".

Cover: expand the background image to be large enough so that the background image completely covers the background area.

Some parts of the background image may not be displayed in the background positioning area.

Contain: expands the image to its maximum size so that its width and height fully fit the content area.

The above is all the content of the article "how to realize the Grid background in CSS3". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report