How can the block-level elements be displayed in CSS?

Source: Internet
Author: User
Question: How do we make two block-level elements in the same row?

Reply:

1. Set float property \ (^o^)/~

The CSS format for block-level elements is set to Float:left/right, for example, there are two Panel,panela and Panelb, want to be on the same line, only need to set a CSS format for float:left/right. (Note: Just set the float property of a Oh, if the float property of B is set, then the element after B is also on the same line.) ), if you use this method, two block-level elements are next to each other. Examples of effects:

2. Set display to Inline-block, that is, to write CSS code display:inline-block. Using this method, two block-level elements have a certain interval between them. Note that the method is the same as the previous method, and you still need to set the display property of a, not the property of B. Examples of effects:

Related Article

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.