Common layout problems with HTML

Source: Internet
Author: User

Some common problems with HTML layouts:

1. When the picture and text house are on the same line, the position text of the adjustment picture will move along with it. To make the picture, the text is centered vertically need to have the picture and the text containing the label at the same time set diplay:inline-block; the picture is centered with Vertical-align:middle, the text is centered with line-height or vertical-align: Middle.

2. Universal Clear Float

. clearfloat{

Clear:both;

height:0;

line-height:0;

}

The CSS can be used to clear the float of floating element A above clearfloat, so that it has a single line. The following element B will no longer be displayed on the same line as a, even if the width is sufficient.

This article from "Day-dream's Blog" blog, reproduced please contact the author!

Common layout problems with HTML

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.