In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces what the CSS alignment method has related knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe you will have something to gain after reading this CSS alignment method, let's take a look at it.
1. Use margin attribute to align horizontally
You can align elements by setting the left and right margins to "auto". But only if it is declared! DOCTYPE, otherwise it is invalid in IE8. This allows you to center the element, for example:
Use the margin property to align horizontally
Tip: if the width is 100%, the alignment has no effect.
2. Use the position attribute for left and right alignment
Using this method is undoubtedly the best way to use the compatibility section, but when using the position property, always set! DOCTYPE to declare that there is a problem with IE8 and earlier versions. If the container element (in our case) sets the specified width and omits the! DOCTYPE declaration, then IE8 and earlier versions will increase the margin of 17px on the right. For example:
Use the position property for left and right alignment
3. Use the float attribute for left and right alignment
There is a problem with IE8 and earlier versions when using the float attribute. If you omit the! DOCTYPE declaration, IE8 and earlier versions will increase the margin of 17px on the right. This seems to be the space reserved for the scroll bar. When using the float property, always set the! DOCTYPE declaration: for example:
This is the end of the article on "what are the methods of CSS alignment?" Thank you for reading! I believe you all have a certain understanding of "what are the methods of CSS alignment". If you want to learn more, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.