IE6 span line feed solves span float: right cannot be right-aligned, but display line feed

Source: Internet
Author: User

IE6 span line feed solves span float: right cannot be right-aligned, but display line feed

Example: how to solve the problem of right alignment of span. This method has been tested and can be correctly displayed on the same line in IE8 and Firefox browsers, in the 360 browser, the word "span right alignment problem" is displayed on the rightmost side of the next line. The reason and solution are as follows:

When the non-float element and the float element are together, if the non-float element comes first, the float element will be excluded.

That is to say, your span is float: Right, but the content in the previous H1 "How to Solve" is still float: None. If you want the text to occupy the same line, there are two solutions:

1. Place the question code with the right alignment of span in front


2. Set the float attribute for the previous text

Note: The code above in IE6 cannot be properly displayed today. The solution of IE6 is as follows:

Add a _ margin-top:-20px to the span after the span float: right (the value can be adjusted as needed), that is

How to solve the right alignment of Span

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.