HTML tag Differences

Source: Internet
Author: User

The difference between a div and a span
A DIV is a block-level element that can contain paragraphs, tables, and so on for placing different content. In general, we use DIV to lay out each chunk in a webpage.
span is an inline element with no practical meaning, it exists purely to apply a style, and a <span></span> tag for a piece of content can be styled by defining a style on a span.

Ii. the difference between relative and absolute
Relative,css in the wording is: position:relative; He means absolute relative positioning, he is referring to the original point of the parent is the original point, no parent is the original point of the body as the original point, with TRBL to locate, when the parent has padding and other CSS properties, the current level of the original point of the parent content area to refer to the original point to locate.
Absolute,css in the wording is: position:absolute; He means absolute positioning, he is referring to the top left corner of the browser, with the top, right, BOTTOM, Zuo (hereinafter referred to as TRBL) for positioning, in the absence of TRBL, join the network by default according to the parent to do the original point of the original point. If you set TRBL and the parent does not set the Position property, the current absolute is positioned as the original point in the upper left corner of the browser, and the position is determined by TRBL.

Iii. the difference between display and visibility
Display:none and Visibility:hidden can hide an element
But Visibility:hidden only hides the content of the element, but the location space it uses is still preserved.
Display:none, in turn, removes the element from the page and the occupied position is removed.

HTML tag Differences

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.