Overflow and text-indent:-9999px font hiding and input value offset

Source: Internet
Author: User
As a Web Front-end developer, for HTML semantics, you often need to add titles to the content module to make the page more meaningful.
Of course, our image buttons can smoothly get the page information without leaving CSS for streaking.
We usually use images instead of fonts to deliver better visual effects.
Earlier front-end development often did not provide content directly in HTML (the content is blank), so that it could not know what the block is when it was not loaded to CSS.

Usually, text-indent:-9999px is used to offset the font. However, he has a limitation that he only applies to block-level element blocks.
Sometimes we want to offset the font on a, so the problem arises: Text-indent:-9999px; although it is more comfortable to use
If a is converted into a block, the element behind him is often pushed to the next line by him. If this A is followed by a button
It is necessary to use float to float behind him so that the crowd will appear again. Is that a little troublesome?
Therefore, we recommend that you use
Line-Height: 0;
Font-size: 0;
Overflow: hidden;
Can "hide" the font above your background perfectly
Ie6.0, 7.0, 8.0, and Firefox 3.010 passed the test.

However, it is difficult to hide the input value.
So we can only use block and text-indent to "offset" to simulate hiding.
Display: block;
Font-size: 0;
Line-Height: 0;
Text-indent:-9999px;
Ie6.0, 7.0, and Firefox 3.010 passed the test.

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.