8.16. CSS Picture

发布时间 :2024-01-17 23:00:04 UTC      

This section will show you how to use CSS to lay out pictures.

8.16.1. Rounded corner picture

Example

Fillet picture:

img{
    border-radius:8px;
}

Example

Oval picture:

img{
    border-radius:50%;
}

8.16.2. Thumbnail image

We use border property to create a thumbnail.

Example

img{
    border:1px solid #ddd;
    border-radius:4px;
    padding:5px;
}
<img src="paris.jpg" alt="Paris">

Example

a{
    display:inline-block;
    border:1px solid #ddd;
    border-radius:4px;
    padding:5px;
    transition:0.3s;
}
a:hover{
    box-shadow:0 0 2px 1px rgba
    (0, 140, 186, 0.5);
}
<a href="paris.jpg">
  <img src="paris.jpg" alt="Paris">
</a>

8.16.3. Responsive picture

Responsive pictures automatically adapt to screens of all sizes.

In the example, you can view the effect by resizing the browser:

Image0

If you need to zoom the picture freely and the size of the picture is not larger than its original maximum, you can use the following code:

Example

img{
    max-width:100%;
    height:auto;
}

Tip: Web responsive design can refer to the CSS responsive design tutorial for more information.

8.16.4. Picture text

How to locate the picture text:

Example

Image0

Lower left corner

Upper left corner

Upper right corner

Lower right corner

In the middle

8.16.5. Card picture

Example

div.polaroid{
    width:80%;
    background-color:white;
    box-shadow:0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0,
0, 0.19);
}
img{width:100%}
div.container{
    text-align:center;
    padding:10px 20px;
}

8.16.6. Picture filter

CSS filter attributes are used to add visual effects to elements (for example, blur and saturation).

Note: this attribute is not supported by Internet Explorer or Safari 5.1 (and earlier).

Example

Change the color of all pictures to black and white (100% grayscale):

img{
    -webkit-filter:grayscale(100%); /\* Chrome, Safari, Opera \*/
    filter:grayscale(100%);
}

Tip: visit the CSS filter reference manual for more information.

8.16.7. Responsive photo album

Example

.responsive{
    padding:0 6px;
    float:left;
    width:24.99999%;
}
@media only screen and (max-width: 700px){
    .responsive{
        width:49.99999%;
        margin:6px 0;
    }
}
@media only screen and (max-width: 500px){
    .responsive{
        width:100%;
    }
}

Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.