php
<a href='.$row5['url'].'"><img src="../asset/view-as-pdf.jpg"
width="94" height="94" /></a>
html
<center>
<a href="http://tools.com/com/fli7ppdf/K171/157/Kap157_E/files/kap157_en.pdf"">
<img src="asset/view-as-pdf.jpg" height="94" width="94" />
</a>
</center>
after click image, it not open url, but view image. how to fix it
<center><a
href="http://kstools.com/com/flippdf/K11/15/Kap15_E/files/kap15_en.pdf""><a
target="_blank" href="asset/view-as-pdf.jpg"><img
src="asset/view-as-pdf.jpg" height="94" width="94"></a></a></center>
Here you are closing a twice.
Your code should like this ,
<center><img src="asset/view-as-pdf.jpg" height="94" width="94"></center>
HTML
<center>
<a href="http://kstools.com/com/flippdf/K11/15/Kap15_E/files/kap15_en.pdf"">
<img src="asset/view-as-pdf.jpg" height="94" width="94" />
</a>
</center>
Remove anchor tag which has link of the image.
Related
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!
Is it possible to show /hide iframe when user clicks on a link? I've used it to show hide .jpg files but with an iframe it doesnt seem to work..
<h3><a onclick="wp_showhide.main(this, 'spoiler1')" href="javascript:void(0)">
["Show", "Hide", "invisible"]
</a></h3>
<div id="spoiler1">
<a href="http://www.newyorker.com/online/blogs/photobooth/NASAEarth- 01.jpg">
<img class="aligncenter size-full wp-image-56" alt="Image" src="http://www.newyorker.com/online/blogs/photobooth/NASAEarth-01.jpg" width="1291" height="783" />
</a>
</div>
Please help
In Chrome image and the text link is aligned properly. However, when I check it on IE8, I noticed that image and text link is not align properly.
Here is the code I use. this is a code I use in Wordpress wpfilebase templates.
<td style="width:350px;padding-left:20px;">
<a href="%file_url%">
<img align="top" src="%file_icon_url%" alt="%file_display_name%" height="40" />
</a>
<span style="width:200px;float:right;vertical-align:text-top;">
%file_display_name%</span>
</td>
Chrome renders properly, but not IE. How to fix this? If I need to use conditional CSS for IE, what is the correct code for IE?
Your 'span' tag closes before you close your 'a' tag. Corrected Code:
<td style="width:350px;padding-left:20px;">
<a href="%file_url%">
<img align="top" src="%file_icon_url%" alt="%file_display_name%" height="40" />
</a>
<span style="width:200px;float:right;vertical-align:text-top;">
%file_display_name%
</span>
</td>
Try this,
<td style="width:350px;padding-left:20px;" valign="top"><!--use valign top here -->
<a href="%file_url%">
<img align="top" src="%file_icon_url%" alt="%file_display_name%" height="40" alt="img" />
</a>
<span style="width:200px;padding-left:10px;vertical-align:text-top;"> <!--remove float and add padding here-->
%file_display_name%<!--anchor tag should be closed here-->
</span>
</td>
Use padding-left in span element and remove float property from it.
Using div tag instead of span, solved my issue.
<td style="width:350px;padding-left:20px;" valign="top"><!--use valign top here -->
<div style="float:left;"><a href="%file_url%">
<img align="top" src="%file_icon_url%" alt="%file_display_name%" height="40" alt="img" />
</a></div>
<div style="max-width:200px;padding-left:10px;vertical-align:text-top;"> <!--remove float and add padding here-->
%file_display_name%<!--anchor tag should be closed here-->
</div>
</td>
<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.
I made my first attempt here to create my own webpage.. But what can be the error in the code i wrote here?
<div align=center>
<img src="icons/twittergrey.png" alt="Twitter" name="Twitter" width="48" height="48" border="0" id="Twitter" />
<img src="icons/facebookgrey.png" alt="Facebook" name="Facebook" width="48" height="48" border="0" id="Facebook" />
<img src="icons/youtubegrey.png" alt="YouTube" name="YouTube" width="48" height="48" border="0" id="YouTube" />
<img src="icons/rssgrey.png" alt="RSS" name="RSS" width="48" height="48" border="0" id="RSS" />
<img src="icons/androidgrey.png" alt="Android Market" name="Android Market" width="48" height="48" border="0" id="Android Market" />
<a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Twitter','','icons/twitter.png',1)">
<a href="#" target="_blank" onmouseover="MM_swapImage('YouTube','','icons/youtube.png',1)" onmouseout="MM_swapImgRestore()">
Sorry i got this loong lines here.. Dunno how i could make it look like a list..
Well there's only two problems I can see, the first is that the center should be in speech marks, so it should look like ="center". Secondly you need to add </div> at the end... Should work then :D
After breaking your lines, a couple of your anchors are missing the </a> on them, which I'm sure is going to be causing some problems for you.
Also, align="center" is deprecated. Use style="text-align: center" instead.
P.S. You really shouldn't write your code all on one line like that (at least hopefully you aren't). All that will cause is problems like this.
You have an embedded anchor tag in an anchor tag (may cause problems) you also are missing two ending anchor tags and an ending div tag as noted by others.
Your markup is really confusing though XD
cleaned up (a little) version of your markup
http://jsfiddle.net/MZge2/1
You need to Close
<div align=center> with </div>
<div align=center> Should be <div align="center">