Css controls the size and style of img images

Source: Internet
Author: User

Many websites' friends use width and height to directly control the image size in the img label, which undoubtedly increases the file size and cannot achieve satisfactory results, today, let's take a look at how I use css to indirectly control the image size. next let's take a look at an instance.

The code is as follows: Copy code

<Ul>

<Li> </li>

</Ul>

We just need to write the line as above. Let's make it with css.

The code is as follows: Copy code

Ul li img {
Width: 80px;
Height: 80px;
Border: 1px solid # ccc;
}

Ul li a: hover img {
Border-color: #333;
}

After this code is added, when you refer to the image, it will have a border, and it will disappear when you move it. Haha, this is a good effect. Now let's talk about it,

Finally, I would like to declare that the original article on this site is Reprinted. Please indicate the origin site: www.111cn.net China WEB first stop

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.