In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces the chrome, firefox, IE in the input input cursor dislocation how to do, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian with you to understand.
Detailed explanation of misplaced position of input input cursor in browser
Try to find solutions to the problems encountered at work, there are really some! Write it down for your own convenience and for others.
I have encountered a problem in the project before.
The input input box is simulated with a background image, setting the height of height and line-height to the same height so that the input text inside can be centered.
What happens under FF is that when you click input, the input cursor is actually as high as the height of input, but when you start typing text, the cursor becomes as high as the text
The cursor under chrome is as high as the height of input.
Under IE, the cursor is the same size as the text.
I never understood why it was like this. I didn't know why until I listened to the discussion of my classmates in the Louvre today.
The preliminary conclusions are as follows:
IE: whether the line has text or not, the cursor height is the same as font-size.
FF: when the line has text, the cursor height is the same as font-size. When the line has no text, the cursor height is the same as the height of input.
Chrome: when the line has no text, the cursor height is the same as line-height; when the line has text, the cursor height is from the top of the input to the bottom of the text (both cases are when line-height is set), if there is no line-height, it is the same as font-size.
Solution:
Setting a small height to the height of input and then filling it with padding can basically solve the problem of all browsers.
The code is as follows:
Input {
Height:16px
Padding:4px0px
Font-size:12px
}
Thank you for reading this article carefully. I hope the article "how to misplace the input input cursor in chrome, firefox and IE" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
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.