Display & position_CSS/HTML

Source: Internet
Author: User
Display & amp; position display: block: the sub-object is presented as a block object. Display is required for many inline styles.

<Style type = "text/css"> # photo a img {border: 3px solid # FF6600 ;}# photo a: hover {display: block ;} /** if this sentence is not added, the inline object img style will not display **/# photo a: hover img {border: 2px solid blue ;} </style> <p id = "photo"> </p>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]


The size of position Content determines the object size based on the layout size.

<P> <style type = "text/css"> # text {position: relative;}/** if no, the inline object is not displayed. If it is a block, the dotted line is too long as a block-level element. The length of posigion is determined by the text content. **/# Text span {width: 200px; height: 20px; border-bottom: 1px dashed #000000 ;} </style> </P> <p id = "text"> example text underline style </p> </P>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]

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.