HTML and CSS Basics points (i)

Source: Internet
Author: User

Pseudo-Class selectors:

Pseudo-class is directly behind the element with ":", such as a:hover, can be used directly in CSS instead of in HTML like class definition, because the browser is pre-set.

A general order is: a:link{} not visited status link

a:visited{} visited Status link

a:hover{} state on mouse hover

There are other pseudo-classes, such as First-child, that correspond to the first child element, last-child the last child element, Nth-child (even/2n) An even number of child elements, and Nth-child (odd/2n+1) The odd number of child elements.

Definition of Box model:

CSS considers each element to be a box, including the following properties:

Content Areas Contents Area: Contains content, content can determine the size, you can also set the width and height. The element's Width property specifies the width of the content area, which can be specified by pixel or as a percentage relative to the size of the container, such as the body Div, where the element resides.

Padding padding: A transparent area outside the content area, which can be seen as part of an element, setting the background of the element to extend to the inner margin.

Border border: The border around the inner margin.

Margins margin: A transparent area outside the bounding rectangle that provides the interval between elements and elements, and the element background does not extend to the margin. The left and right margins of the element (inline, like) are added, and the upper and lower margins of the (block element) are folded, taking the largest, and nesting. Additionally, the margins of the floating element and the margins in the normal flow are not collapsed.

HTML and CSS Basics points (i)

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.