I developed a regular link that resembles a button in the Sencha Touch 2 mobile application, and I have problems with most of the links that do not work in Safari on the iPhone.
The link is a regular <a> tag with an internal <span> element containing the label text. The <a> element has an addition that allows you to register indentation. It seems that the internal <span> blocks the taps from registering in the parent anchor as a link, and its background is transparent.
Here's the markup:
<a href="http://test-site.xx/full-site-page?param=value" class="x-button-normal x-button btn-profile"> <span class="x-button-label">View profile on full site</span> </a>
Testing this in Chrome presents no problems, i.e. when you click on span, a transition to the parent hyperlink takes place. Both browsers are based on Webkit. One of our testers also tested this on Safari on a Macbook without problems; I also tested this in Chrome using a Wacom Bamboo tablet without any problems. This is only a problem on mobile devices (tested on both iPhone and Android 2.2) - thatβs what we aim for.
Is there a CSS property that I can set in the <span> element to allow faucets to jump to the parent hyperlink? Ideally, I want to avoid the need to set events through JavaScript. Any ideas as to why this is not working as I expected?
Refresh . Here are the styles for the inner range reported by the Chrome Developer Console:
-webkit-box-align: center; -webkit-box-flex: 1; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-user-drag: none; -webkit-user-select: none; background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; border-bottom-color: white; border-bottom-style: none; border-bottom-width: 0px; border-left-color: white; border-left-style: none; border-left-width: 0px; border-right-color: white; border-right-style: none; border-right-width: 0px; border-top-color: white; border-top-style: none; border-top-width: 0px; box-shadow: none; box-sizing: border-box; color: white; cursor: auto; display: inline; font-family: 'Helvetica Neue', HelveticaNeue, Helvetica-Neue, Helvetica, 'BBAlpha Sans', sans-serif; font-size: 18px; font-weight: bold; height: auto; line-height: 21px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: static; text-align: center; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; width: auto;
Many thanks.
html css safari iphone sencha-touch-2
d_mcg
source share