IMG and input tags in CSS

Source: Internet
Author: User

In general, it is not valid to set the width height of the inline element, and a label is common. IMG and input also belong to the inline element, but they can set the width high!!!!!

Read some of the data to understand that the original CSS elements there is another way to classify, replaceable elements, not replaceable elements.

A) replaceable elements

The browser determines the specific display of the element based on the properties of the tag. Like the IMG tag, the browser reads the image information (including the width and height of the image) through the SRC attribute to display it. The input tag, by its Type property, determines whether it is a text field (type= "text"), or a Submit button (type= "submit"), and, for form elements, the browser has a default style, including width and height. So the replacement element generally has the width and Height properties, and you can set or change its width height.

b) Non-replaceable elements

Most elements are non-replaceable elements whose content is directly represented to the client (such as a browser);

Almost all of the replaceable elements are inline elements, such as Img,input. So that's why the inline element img,input can be set to a wide height.

IMG and input tags in CSS

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.