Linking each image to the site it is from - html

This is my code:
<a target="_blank" href="http://weknowyourdreams.com">Family</a>
<img src="http://weknowyourdreams.com/images/family/family-02.jpg" height="140" width="300">
</a>
<a target="_blank" href="http://chess.com">Chess</a>
<img height="140" width="300" alt="Chess game" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/6f/ChessSet.jpg/647px-ChessSet.jpg">
</a>
<a target="_blank" href="http://okcstorm.com/index.php/basketball/">Basketball court</a>
<img src="http://okcstorm.com/wp-content/uploads/2016/12/cropped-Basketball-2-1.jpg" width="300" height="200">
What I want to achieve is to link them each to the site that I've got them from. But, the problem is the phone in the code avengers keep telling me this error:
Uncaught TypeError: Cannot read property 'ClearPromptText' of null
I don't know what that means, please help.

.image-f{
float:left;
display:block;
margin-right:10px;
width:300px;
}
.image-f img{
float:left;
width:100%;
height:140;
}
<a target="_blank" class="image-f" href="http://weknowyourdreams.com/" >Family
<img src="http://weknowyourdreams.com/images/family/family-02.jpg" >
</a>
<a target="_blank" class="image-f" href="http://chess.com">Chess
<img alt="Chess game" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/6f/ChessSet.jpg/647px-ChessSet.jpg">
</a>
<a target="_blank" class="image-f" href="http://okcstorm.com/index.php/basketball/">Basketball court
<img src="http://okcstorm.com/wp-content/uploads/2016/12/cropped-Basketball-2-1.jpg" ></a>

Related

How do I refine this code for an email signature?

I am trying to create an email signature using html and an image I designed in Photoshop. I have sliced the image in PS and saved the slices out onto my PC. I now want to add links to certain slices and have managed to do this but the code is very messy and poor so I know that there is a better way to do it. I have attached the code below.
The links are not the actual links and are just placeholders for now. I also know that I need to save the images externally and will get round to it but just want to try and get the code sorted for now. I also understand that the image size is massive for an email signature so can I just add a "max-width" and "max-height" to the code to size it down or do I have to individually change all the sizes of each slice?
Finally, will this a spliced html image display well as an email signature or, because there are so many images attached to it, will it just go straight into spam?
<!DOCTYPE html>
<html>
<style>
div {
position: absolute;
}
</style>
<head></head>
<body>
<a href="" />
<div style="background-image:url('img/img1.jpg'); left:0px; top:0px; width:2000px; height:122px"></div>
<a href="" />
<div style="background-image:url('img/img2.jpg'); left:0px; top:122px; width:124px; height:222px"></div>
<a href="https://www.linkedin.com" />
<div style="background-image:url('img/img3.jpg'); left:124px; top:122px; width:866px; height:198px"></div>
<a href="" />
<div style="background-image:url('img/img4.jpg'); left:990px; top:122px; width:1010px; height:102px"></div>
<a href="" />
<div style="background-image:url('img/img5.jpg'); left:990px; top:224px; width:246px; height:576px"></div>
<a href="https://www.bing.com" />
<div style="background-image:url('img/img6.jpg'); left:1236px; top:224px; width:630px; height:120px"></div>
<a href="" />
<div style="background-image:url('img/img7.jpg'); left:1866px; top:224px; width:134px; height:576px"></div>
<a href="" />
<div style="background-image:url('img/img8.jpg'); left:124px; top:320px; width:866px; height:24px"></div>
<a href="" />
<div style="background-image:url('img/img9.jpg'); left:0px; top:344px; width:122px; height:456px"></div>
<a href="https://www.google.com" />
<div style="background-image:url('img/img10.jpg'); left:122px; top:344px; width:540px; height:150px"></div>
<a href="" />
<div style="background-image:url('img/img11.jpg'); left:662px; top:344px; width:328px; height:456px"></div>
<a href="" />
<div style="background-image:url('img/img12.jpg'); left:1236px; top:344px; width:630px; height:42px"></div>
<a href="" />
<div style="background-image:url('img/img13.jpg'); left:1236px; top:386px; width:48px; height:414px"></div>
<a href="https://www.bing.com" />
<div style="background-image:url('img/img14.jpg'); left:1284px; top:386px; width:482px; height:56px"></div>
<a href="" />
<div style="background-image:url('img/img15.jpg'); left:1766px; top:386px; width:100px; height:414px"></div>
<a href="" />
<div style="background-image:url('img/img16.jpg'); left:1284px; top:442px; width:482px; height:42px"></div>
<a href="" />
<div style="background-image:url('img/img17.jpg'); left:1284px; top:484px; width:62px; height:316px"></div>
<a href="https://www.linkedin.com" />
<div style="background-image:url('img/img18.jpg'); left:1346px; top:484px; width:94px; height:90px"></div>
<a href="https://www.facebook.com" />
<div style="background-image:url('img/img19.jpg'); left:1440px; top:484px; width:60px; height:82px"></div>
<a href="https://www.twitter.com" />
<div style="background-image:url('img/img20.jpg'); left:1500px; top:484px; width:94px; height:90px"></div>
<a href="https://www.instagram.com" />
<div style="background-image:url('img/img21.jpg'); left:1594px; top:484px; width:92px; height:82px"></div>
<a href="" />
<div style="background-image:url('img/img22.jpg'); left:1686px; top:484px; width:80px; height:316px"></div>
<a href="" />
<div style="background-image:url('img/img23.jpg'); left:122px; top:494px; width:540px; height:30px"></div>
<a href="" />
<div style="background-image:url('img/img24.jpg'); left:122px; top:524px; width:2px; height:88px"></div>
<a href="https://www.google.com" />
<div style="background-image:url('img/img25.jpg'); left:124px; top:524px; width:418px; height:62px"></div>
<a href="" />
<div style="background-image:url('img/img26.jpg'); left:542px; top:524px; width:120px; height:276px"></div>
<a href="" />
<div style="background-image:url('img/img27.jpg'); left:1440px; top:566px; width:60px; height:234px"></div>
<a href="" />
<div style="background-image:url('img/img28.jpg'); left:1594px; top:566px; width:92px; height:234px"></div>
<a href="" />
<div style="background-image:url('img/img29.jpg'); left:1346px; top:574px; width:94px; height:226px"></div>
<a href="" />
<div style="background-image:url('img/img30.jpg'); left:1500px; top:574px; width:94px; height:226px"></div>
<a href="" />
<div style="background-image:url('img/img31.jpg'); left:124px; top:586px; width:418px; height:26px"></div>
<a href="https://www.google.com" />
<div style="background-image:url('img/img32.jpg'); left:122px; top:612px; width:406px; height:62px"></div>
<a href="" />
<div style="background-image:url('img/img33.jpg'); left:528px; top:612px; width:14px; height:188px"></div>
<a href="" />
<div style="background-image:url('img/img34.jpg'); left:122px; top:674px; width:406px; height:126px"></div>
</body>
</html>
Email is not web! Absolute positioning is an advanced trick that requires lots of hacks to work, and even <div>s are problematic, for Outlooks. Background images are also very tricky (there are plenty of answers on SO about these things individually).
Nobody knows all the spam rules, because otherwise people would subvert them, however, having so many links at the bottom of your message could easily be considered spammy. It's also risky because it's not normal. So I would advise against this method.
You will want to produce a HTML table, with <img>s (or just one image). However, best practice is to write out text in HTML, rather than have it in the image. I can't see the image so I can't give you sample code, other than something generic for a scalable image:
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<a href="#">
<img src="https://via.placeholder.com/600x200" width="600" style="max-width:100%;height:auto;" />
</a>
</td>
</tr>
</table>
</body>

Remove underline from linked images

I'm adding custom social media icon links on my website (Wordpress) and there is a stubborn line that runs through them just like hyperlinks. The line disappears when mouse hovers over image, just link other hyperlinks on page.
This is the code used to create them:
.custom-social img {
text-decoration: none;
margin-right: 20px;
}
<div class="custom-social">
<a href="http://twitter.com/mrsideproject">
<img title="Twitter" alt="Twitter" src="http://coinpages.co/wp-content/uploads/2018/01/twitter-badge.png" width="35" height="35" />
</a>
<a href="http://medium.com/#mrsideproject">
<img title="Medium" alt="Medium" src="http://coinpages.co/wp-content/uploads/2018/01/medium-logo.png" width="35" height="35" />
</a>
<a href="http://instagram.com/mrsideproject">
<img title="Instagram" alt="Instagram" src="http://coinpages.co/wp-content/uploads/2018/01/Instagram-badge.png" width="29" height="30" />
</a>
</div>
The text-decoration is on the a, not the img.
Add text decoration in anchor tag. Use Css:
.custom-social a {
text-decoration: none;
margin-right: 20px;
}
Just as Daniel said, text-decoration:none is supposed on the anchor tag.
.custom-social a {
text-decoration: none;
}
.custom-social img{
margin-left:20px;
}
<div class="custom-social">
<a href="http://twitter.com/mrsideproject">
<img title="Twitter" alt="Twitter" src="http://coinpages.co/wp-content/uploads/2018/01/twitter-badge.png" width="35" height="35" />
</a>
<a href="http://medium.com/#mrsideproject">
<img title="Medium" alt="Medium" src="http://coinpages.co/wp-content/uploads/2018/01/medium-logo.png" width="35" height="35" />
</a>
<a href="http://instagram.com/mrsideproject">
<img title="Instagram" alt="Instagram" src="http://coinpages.co/wp-content/uploads/2018/01/Instagram-badge.png" width="29" height="30" />
</a>
</div>
OK, I figured it out! not entirely sure why text-decoration wasn't having any effect but this did the trick:
.custom-social a {
border:0;
}

Controls html5 player

Hiya people i was hoping for some help for no reason the controls on chrome do not appear but they do on mozilla and IEcrappycrap do you have any idea about what could do it , i'm using a 360VR player (Bitmovin) dunno if it could have a link but when i take off the bitmovin player embed in a div , the controls works ...
<body onload="Onload()">
<div id="background">
<img id="bg" class="bg" src="http://slpubmedias.tf1.fr/test_nocache/test_jf/Orange/Orange2/Bg_m.jpg" style="position:absolute;"/>
<img id="redirection" class="redi" onclick="Redirection()" src="http://slpubmedias.tf1.fr/test_nocache/test_jf/Orange/Orange2/btn_1.gif" style="cursor:pointer;position:absolute;"/>
</div>
<div id="container">
<a href="javascript:;" onClick="Bandeau(1);" > <img id="bandeau_top" class="bandeau" src="http://slpubmedias.tf1.fr/test_nocache/test_jf/Orange/Orange2/Pub_haut_m.jpg" style="position:absolute;"/></a>
<img id="Fleche_G" class="fleche" onclick="Left()" src="http://slpubmedias.tf1.fr/test_nocache/test_jf/Orange/Orange2/fleche_gauche_m.png" style="position:absolute;"/>
<img id="Fleche_D" class="fleche" onclick="Right()" src="http://slpubmedias.tf1.fr/test_nocache/test_jf/Orange/Orange2/fleche_droite_m.png" style="position:absolute;"/>
<div class="content">
<div class="player-wrapper">
<div id="playerDiv">
//bitmovinplayerembed here
</div>
</div>
</div>
<iframe name="__bkframe" height="0" width="0" frameborder="0" style="display:none;position:absolute;clip:rect(0px 0px 0px 0px)" src="about:blank"></iframe>
<video id="video1" controls preload="none" onclick="Stop()" src="http://slpubmedias.tf1.fr/test_nocache/test_jf/Orange/ours.mp4" style="position:absolute;"></video>
<img id="Video_played" class="Video" src="http://slpubmedias.tf1.fr/test_nocache/test_jf/Orange/dark.gif" style="position:absolute;"/>
<div id="Choix">
<a href="javascript:;" onClick="Play(1);" > <img id="Vid_1" src="http://slpubmedias.tf1.fr/test_nocache/test_jf/Orange/Orange2/Vignette1_produit1_m.jpg" style="position:absolute;"/></a>
<a href="javascript:;" onClick="Play(2);" ><img id="Vid_2" src="http://slpubmedias.tf1.fr/test_nocache/test_jf/Orange/Orange2/Vignette2_produit2_m.jpg" style="position:absolute;"/></a>
<a href="javascript:;" onClick="Play(3);" ><img id="Vid_3" src="http://slpubmedias.tf1.fr/test_nocache/test_jf/Orange/Orange2/Vignette3_film_m.jpg" style="position:absolute;"/></a>
<a href="javascript:;" onClick="Play(4);" ><img id="Vid_4" src="http://slpubmedias.tf1.fr/test_nocache/test_jf/Orange/Orange2/Vignette4_betisier_m.jpg" style="position:absolute;"/></a>
<a href="javascript:;" onClick="Play360(360);" ><img id="Vid_5" src="http://slpubmedias.tf1.fr/test_nocache/test_jf/Orange/Orange2/Vignette5_360_m.jpg" style="position:absolute;"/></a>
<img id="text_video" src="http://slpubmedias.tf1.fr/test_nocache/test_jf/Orange/Orange2/text360_m.png" style="position:absolute;"/>
</div>
<div id="Jeu_container">
<img id="Jeu_played" class="Jeu" src="http://slpubmedias.tf1.fr/test_nocache/test_jf/Orange/Orange2/Jeu_m.jpg" style="visibility:hidden;position:absolute;"/>
<iframe id="iframe" src="http://www.jeubignoel.com/"></iframe>
</div>
<a href="javascript:;" onClick="Bandeau(2);" ><img id="bandeau_bot" class="bandeau" src="http://slpubmedias.tf1.fr/test_nocache/test_jf/Orange/Orange2/Pub_bas_m.jpg" style="position:absolute;"/></a>
<p id="mention2">
Big = grand
</p>
<p id="mention">
</p>
<img id="track" src="http://slpubmedias.tf1.fr/test_nocache/test_jf/BlindSpot/Desktop/empty.png" style="position:absolute;">
</div>
The Bitmovin Player explicitly hid Chrome's native video element controls using CSS. Instead of hiding just the one of the used video element, it did this for all video elements on the website. This has been fixed in version 7 of the player, so you should not experience this problem anymore with the latest stable version.

Href while running localhost not working

so im designing a website using html, php, all that fun stuff & im trying to make facebook, twitter, youtube & instagram links that will open a new tab and take you to the website. but at the moment the URL is going to localhost/horizonphotography/www.facebook.com instead of opening the new tab and THEN going to www.facebook.com.
heres my HTML
<div class="social">
<a href="www.facebook.com" target="_blank">
<img border="0" alt="Facebook" src="img/facebook.png" width="50" height="50">
</a>
<a href="www.twitter.com" target="_blank">
<img border="0" alt="twitter" src="img/twitter.png" width="50" height="50">
</a>
<a href="www.youtube.com" target="_blank">
<img border="0" alt="youtube" src="img/youtube.png" width="50" height="50">
</a>
<a href="www.instagram.com" target="_blank">
<img border="0" alt="instagram" src="img/instagram.png" width="50" height="50">
</a>
</div>
and my css 'if' required.
.social {
position: fixed;
bottom: 0;
right: 7%;
width: 300px;
}
thanks in advance!
Try using a protocol like http:// or // to external links like this :
<a href="http://www.facebook.com" target="_blank">
<img border="0" alt="Facebook" src="img/facebook.png" width="50" height="50">
</a>
See this good answer on SO : https://stackoverflow.com/a/8951636/6028607
You need to specify the protocol, or put // at the start of the href attribute. For example:
http://www.youtube.com
Or
//www.youtube.com
Awesome, needed to identify the protocol as suggested. working well now! thanks everyone!

why I am getting small dash in anchor tag?

<a href="service.html">
<img width="175" height="40" style="margin-left:20px; margin-top:10px; margin-bottom:10px;" src="image/Sea Freight.png"/>
</a>
<a href="airfreight.html" >
<img width="175" height="40" style="margin-left:20px; margin-top:10px; margin-bottom:10px;" src="image/Air Freight.png">
</a>
<a href="projectcargo.html">
<img width="175" height="40" style="margin-left:20px; margin-top:10px; margin-bottom:10px;" src="image/Project Cargo.png">
</a>
<br/>
<a href="customclearance.html" >
<img width="175" height="40" style="margin-left:20px; margin-top:10px; margin-bottom:10px;" src="image/Custom Clearance.png">
</a>
<a href="transportation.html" >
<img width="175" height="40" style="margin-left:20px; margin-top:10px; margin-bottom:10px;" src="image/Domestic Transportation.png">
</a>
<a href="thirdparty.html" >
<img width="175" height="40" style="margin-left:20px; margin-top:10px; margin-bottom:10px;" src="image/Warehousing and Distribution.png">
</a>
</br>
<a href="coastalcargo.html" >
<img width="175" height="40" style="margin-left:20px; margin-top:10px; margin-bottom:10px;" src="image/Coastal Cargo.png">
</a>
<a href="veseelchartering.html" >
<img width="175" height="40" style="margin-left:20px; margin-top:10px; margin-bottom:10px;" src="image/Vessel Chertring.png">
</a>
</br>
I have create button by using img tag within anchor.
why I am getting small dash at right corner??
thanks in advance
There is a default text-decoration:underline associated with an anchor <a> tag. Since there is a space in the <a> </a>, that underline is the line you see.
Use text-decoration:none on <a>, that should solve it.
a {
text-decoration: none;
}
This appears to happen when:
the closing anchor tag is on a separate line from the rest of the element
AND the visible text of the anchor is an image
AND you have multiple images on the same line
and also the anchor/image is not the last item in the horizontal series
In the following example, you will not see dashes after the third and fifth images, but the other images will show a dash to the right of the image/link:
<p>
<a href="#">
<img src="image.jpg" alt="Test 1" />
</a>
<a href="#"><img src="image.jpg" alt="Test 2" />
</a>
<a href="#">
<img src="image.jpg" alt="Test 3" /></a>
<a href="#"><img src="image.jpg" alt="Test 4" />
</a>
<a href="#"><img src="image.jpg" alt="Test 5" />
</a>
</p>
I can't find any information to say if this is a violation of an HTML rule regarding splitting elements across multiple lines. I replicated the same issue in Chrome, Firefox and IE 11.
I can only guess that a space is being added after the image, since the closing tag is on a separate line. And this relates to the answers given above - the space is being automatically styled with an underline. But I don't know why the space is added after an image but not after text, or why this only happens when the images are on the same line.
<a> is an inline element. If you leave space between enclosed elements and the </a> element, it will be formatted automatically which is with an underscore.