img in Safari gets hidden - html

I have three icons (links with images inside) on my website that I want to link to my GitHub, Linked In and email accounts. It works fine on Chrome but for some reason Safari adds a bunch of styles to the Linked In icon that make it hidden.
Here's the code for the three links (the links have been changed):
<a href="http://github" target="_blank">
<img src="img/github.png" alt="GitHub">
</a>
<a href="http://linked in" target="_blank">
<img src="img/linkedin.png" alt="LinkedIn">
</a>
<a href="mailto:me#mail.com">
<img src="img/email.png" alt="E-mail">
</a>
This is the styling for the links (I'm using SASS so the styles are nested):
a {
position:relative;
padding-right:25px;
padding-left:25px;
img {
width:64px;
height:64px;
}
}
In Chrome, this works exactly the way I want it to, when I inspect the page, this is what it shows:
But for some reason, in Safari, the Linked In icon is hidden, and the inspector shows this:
The inspector shows this for the Linked In image:
<img src="img/linkedin.png" alt="LinkedIn" style="display: none !important; visibility: hidden !important; opacity: 0 !important; background-position: 0px 0px;" width="0" height="0">
Any thoughts on why Safari is doing this, and how I could fix it would be appreciated, thanks!

Doh! I had AdBlock installed on Safari, and that was blocking the image. Disabled AdBlock and it works just fine.

Related

HTML link to App Store not working in iOS 10.3 Safari

I have a banner widget that is placed on third-party sites. The banner ad is to download an app via iOS App Store or Google Play. The links work perfectly on desktop browsers, but for some reason, on iOS Safari (iOS v10.3) the App Store link is dead yet the Google Play link works fine.
iOS link returns "Safari cannot open this page because the address is invalid". The link is valid, as it works on desktop browsers.
Any suggestions for getting this link to work on iOS Safari?
Below is the HTML and CSS for the links:
HTML
<a class="mobile-app-link" href="https://itunes.apple.com/us/app/id12345" target="_blank">
<span class="mobile-app-span">
<img class="mobile-app-image" alt="-" src="https://devimages.apple.com.edgekey.net/app-store/marketing/guidelines/images/badge-download-on-the-app-store.svg">
</span>
</a>
<a class="mobile-app-link" href="https://play.google.com/store/apps/details?id=<id>" target="_blank">
<span class="mobile-app-span">
<img class="mobile-app-image" alt="-" src="https://play.google.com/intl/en_us/badges/images/badge_new.png">
</span>
</a>
CSS
.mobile-app-image
width: 119px
height: 35px
.mobile-app-link
text-align: center
display: inline-table
vertical-align: middle
margin: 0 10px 20px 0
.mobile-app-span
display: table-row
I'm not sure if this is the ideal solution, but it turns out that what was wrong was the iTunes link itself. Replacing the link with http://www.google.com worked fine. So I decided to execute the link using JavaScript:
<a class="mobile-app-link" href="#" onclick="window.open(encodeURI('https://itunes.apple.com/us/app/id123456'), '_blank', 'location=yes,enableViewPortScale=yes');">
<span class="mobile-app-span">
<img class="mobile-app-image" alt="-" src="https://devimages.apple.com.edgekey.net/app-store/marketing/guidelines/images/badge-download-on-the-app-store.svg">
</span>
</a>
The link now opens iTunes in a blank window as expected.

href link not working after editing css

I'm trying to update my friend's website and she needs to keep the Genbook button. I copied and pasted the code from her current site into the code I'm currently writing, and it works fine until I try to format it in CSS. Since I want it centered under her logo I need to edit the CSS. I don't understand why editing the CSS would cause the link to become inactive.
Live preview in Firefox: active and unformatted active link, without CSS (notice mouse cursor)
Live preview in Firefox: inactive and formatted inactive link, with CSS (notice mouse cursor)
#genbook {
position: absolute;
top: 210px;
left: 50px;
}
<div id="genbook">
<script src="https://www.genbook.com/bookings/booknowjstag.action?id=30216717&size=medium"></script>
<noscript>
<a href="https://www.genbook.com/bookings/slot/reservation/30216717?bookingSourceId=1000">
<img src="https://www.genbook.com/bookings/images/booknow-button-medium.png" width="150" height="50" alt="Make an Online Appointment" border="0">
</a>
<br>
</noscript>
</div>
Now I'm even more confused! It appears to be working on Codepen and Code Snippet. So... why would it work in preview and then not work in preview?
New question: How do I know if it's really working?
your code, you postet, was in a <noscript></noscript> tag and <script src="https://www.genbook.com/bookings/booknowjstag.action?id=30216717&size=medium"></script> loaded a different code into your DOM, which does not worked. You can remove it an the noscript and it will work.
#genbook {
position: absolute;
top: 210px;
left: 50px;
}
<div id="genbook">
<a href="https://www.genbook.com/bookings/slot/reservation/30216717?bookingSourceId=1000">
<img src="https://www.genbook.com/bookings/images/booknow-button-medium.png" width="150" height="50" alt="Make an Online Appointment" border="0" />
</a>
</div>

Invisible DIV over image link not working in IE 8/9/10

I have an image on my page and I place invisible DIVS overtop the image to allow certain boxes to be clickable. Here is an example of what I mean:
http://jsfiddle.net/FxNYJ/
This works fine in Chrome, Firefox, Opera, Safari. It doesn't seem to work in IE 8, 9 and 10. I don't remember having this problem before when I used to use this technique. Does anyone have any ideas?
The HTML:
<div class="main-image-wrap">
<a id="bannerlink_selfie_create" href="http://google.com" target="_blank" class="overlay-link" style="width:28%;height:10%;top:71%;left:20%;"></a>
<a id="bannerlink_selfie_join" data-toggle="modal" href="http://google.ca" target="_blank" class="join-link overlay-link" style="width:13%;height:4%;top:89%;left:32%;"></a>
<img class="main-image" src`="http://ofbuckleyandbeatles.files.wordpress.com/2011/01/testpattern.gif" alt="">
</div>
The CSS:
.overlay-link {
border: 1px solid red;
display: block;
position: absolute;
z-index: 100;
}

Remove Blue border in IE 10 Compatibility View

How can I remove or just don't display the border links in every anchor with image? By the way, browser settings is in compatibility mode. Answers from other question doesn't suffice to solve my problem. I guess because it only applies with lower version of IE.
EDIT:
I'm currently creating a Custom share buttons where my client requires me.
<div>
<a onClick="window.open('https://twitter.com/intent/tweet?original_referer=#shareLink#&text=#shareTitle#&tw_p=tweetbutton&url=#shareLink#','sharer','toolbar=0,status=0,width=548,height=325');" href="javascript: void(0)">
<img height="20" src="/images/chicklets/Twitter_Tweet.png" />
</a>
</div>
<div>
<a onClick="window.open('http://www.facebook.com/sharer.php?s=100&p[title]=#shareTitle#&p[summary]=#shareDesc#&p[url]=#shareLink#&p[images][0]=images/Telos.jpg','sharer','toolbar=0,status=0,width=548,height=325');" href="javascript: void(0)">
<img height="20" src="/images/chicklets/FaceBook_Share.png">
</a>
</div>
<div>
<a onClick="window.open('http://www.linkedin.com/shareArticle?mini=true&url=#shareLink#&title=#shareTitle#&summary=#shareDesc#','sharer','toolbar=0,status=0,width=548,height=325');" href="javascript: void(0)">
<img height="20" src="/images/chicklets/LinkedIn_Share.png">
</a>
</div>
<div>
<a onClick="window.open('https://plus.google.com/share?url=#shareLink#','sharer','toolbar=0,status=0,width=548,height=325');" href="javascript: void(0)">
<img height="20" src="/images/chicklets/Google_PlusOne.png">
</a>
</div>
CSS:
a {
outline : none;
text-decoration: none;
}
a img {
outline : none;
}
img {
border : 0;
border-style: none;
}
div {
float: left;
padding-right: 10px;
}
Here's what it looks like with IE10:
how about this, try to add something like this
<img src="blah" style="border-style:none;">
I usually use this as part of my normal defaulting set up in my CSS:
img {border: none;}
This doesn't effect the other browsers negatively and is easy to over-ride at a later point if you place this near the top of you general css file e.g
img {border: none;}
img.some-class {border: 1px double blue}
Where the increased specificity will add an ugly border to your image just like IE loves doing.
I was having the exact same issue with IE10. I've just set up a CSS rule for the a tag and set the text colour to white. This removes the blue line from around an anchor image.

image inside href link not working in ie7

I have embeded images as link in href tag, but the images are not working as link in ie7 although the same page is working fine in firefox and ie8. Can anyone help me out of it?
Here is the code
<a href="example.com">
<div class="banner_box_1">
<img src="images/facilities.jpg" width="156" height="70" alt="facilities" />
</div>
</a>
The css applied on image div
.banner_box_1{
width:156px;
height:70px;
float:left;
margin:5px 13px;
}
I think the problem is bcoz of css which is messing up in ie7
Images converted to base64 do not work in ie7, it's an ie7 bug :(
http://dean.edwards.name/weblog/2005/06/base64-ie/
Edit:
Can you even use <div> inside anchor ?