The specific usage of margin:auto in css
This article mainly introduces "the specific usage of margin:auto in css". In daily operation, I believe many people have doubts about the specific usage of margin:auto in css. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "the specific usage of margin:auto in css"! Next, please follow the editor to study!
Description
1. If there is a fixed value on one side, including the default value of 0 without setting the value, and auto on one side, then auto is the size of the remaining space.
2. If both sides are auto, then divide the remaining space equally.
Example
Width: 300px; background-color: # f0f3f9;} .son {width: 200px; height: 120px; margin-right: 80px; margin-left: auto; background-color: # cd0000;} this ends the study of "the specific usage of margin:auto in css", hoping to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!