"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > Why Isn\'t Padding Working in Safari and IE Select Lists?

Why Isn\'t Padding Working in Safari and IE Select Lists?

Published on 2024-11-05
Browse:133

Why Isn\'t Padding Working in Safari and IE Select Lists?

Padding Not Displaying in Select Lists in Safari and IE

Despite the lack of restrictions in the W3 specification, padding in select boxes is not supported by WebKit browsers, including Safari and Chrome. As a result, padding is not applied in these browsers.

To address this issue, consider using text-indent instead of padding-left. Maintain the same indentation amount by incrementing the width of your select box accordingly.

For example, in your code:

By adding text-indent:15px and increasing the width to 258px, the select box will now display the same indent as if it had 15px of left padding, while still functioning correctly in WebKit browsers.

Release Statement This article is reprinted at: 1729731092 If there is any infringement, please contact [email protected] to delete it
Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3