Multiple unlimited css submission buttons are displayed in the center, fixed only by css, and centered by css.

Source: Internet
Author: User

Multiple unlimited css submission buttons are displayed in the center, fixed only by css, and centered by css.

A few days ago, the company fixed the problem of centering multiple buttons in a css file. In fact, many front-end programmers have encountered such problems. For example:

There are three buttons or two buttons in a row... the number is not fixed, and the spacing is fixed. Then many people put all the buttons in a div and set the div to margin: 10px auto (10 pixels above, center, then a fixed width is given, and the button is placed in this div, so that the button cannot be centered). What should I do if the button is reduced to two or one,

Many people also use javascript to dynamically calculate the width and then calculate a lot of data, which is often easier to use.

Error code:

1 <! DOCTYPE html> 2 

 

Modified as follows:

<! DOCTYPE html> 

In fact, these problems seem very simple. There are still many beginners who cannot implement them. Many people also use javascript to implement them. In fact, they are completely unnecessary.

 

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.