Okay im creating a mobile site and I have a page of images and when someone clicks on a image I want it to go to that same image on a different page so im marking the images with <a name="picname"> and then linking them like this:
<img src="filepath/picname.jpg" border="1">
But when I click on a image in a mobile browser it will skip to like right under the image (so you cant see it till you scroll up) what am I doing wrong?
Snippet on page_1.html
<img src="gallery/1.jpg" width="95%" border="1">
<br><br>
<img src="gallery/2.jpg" width="95%" border="1">
<br><br>
<img src="gallery/3.jpg" width="95%" border="1">
<br><br>
<img src="gallery/4.jpg" width="95%" border="1">
<br><br>
<img src="gallery/5.jpg" width="95%" border="1">
<br><br>
<img src="gallery/6.jpg" width="95%" border="1">
Snippet on gallery.html
<a name="1"></a><img width="95%" border="2" alt="" src="gallery/1.jpg"><br>
<a name="2"></a><img width="95%" border="2" alt="" src="gallery/2.jpg"><br>
<a name="3"></a><img width="95%" border="2" alt="" src="gallery/3.jpg"><br>
<a name="4"></a><img width="95%" border="2" alt="" src="gallery/4.jpg"><br>
<a name="5"></a><img width="95%" border="2" alt="" src="gallery/5.jpg"><br>
<a name="6"></a><img width="95%" border="2" alt="" src="gallery/6.jpg"><br>
Any ideas would be great!
Did you try put the anchor close tag before the image?
<!-- -->
<img src="file.jpg" />
Typically you create an individual anchor tag preceding the content you wish to "scroll" to and create a link in another location (either above/below in the same page or on another page).
It sounds like you want a new window to pop up and scroll down to the image? If that's the case, you're going to want to do something like this:
(For this example, we'll pretend that the page name is 'gallery.html')
Click here for this image
And lower on the page (or where ever it may be):
<a name="picid"></a>
<img src="image.png" border="0" />
This will work. I have tested it. If you don't actually want it to open in a new window, just remove the 'target="_blank" ' from the initial hyperlink anchor tag. The problem is that once you add an href, it becomes a hyperlink instead of a standard anchor.
If you wish to have the image clickable and have the page open in a new window (and automatically scroll to the image's location) when you click on the image, the proper setup would be:
<a name="picid"></a>
<img src="image.png" border="0" />
Related
I wanted to have a full-width call-to-action banner on my client's website. The template that my client has does not support CSS, so I'm making use of like old school HTML to build pages.
I have a background image for the img src and I want to overlay the text in it. I'm in need of a code that is working since I'm really not well-versed.
I searched up for solutions in adding overlay text to a background image, but most of the answers contain CSS. Here's a code that I tried.
<table>
<tr>
<td></td>
<td rowspan=4><img src="/uploads/image12345jpg"></td>
</tr>
<tr>
<center><td colspan=4>This is the overlay text</td></center>
</tr>
</table>
</center>
I'd appreciate your help and answers.
The support says that I have to individually add it in the HTML code... not sure where it goes.
I think you might be looking for something like this: https://jsfiddle.net/DIRTY_SMITH/vz04m3ph/2/
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR>
<TD width="221" height="300" background="https://placeimg.com/640/480/any" valign="bottom">
<FONT size="+1" COLOR="red">This is the overlay text</FONT>
</TD>
</TR>
</TABLE>
EDIT:
This question is asking how to use inline styles, I think:
(I've also put some inline javascript on a click function because you mentioned your scripts wernt working either)
https://jsfiddle.net/DIRTY_SMITH/vz04m3ph/28/
<td style="position:relative;">
<img src="https://placeimg.com/640/480/any" style="position:absolute;z-index:1;" width="600px" height="150px" />
<div style="z-index:2;position:relative;color:red;font-weight:bold; font-size: 40px; top: 40px; left: 100px;" onClick="(function(){
alert('See You can click me');
return false;
});">
<a href="#" onClick="(function(){ alert('See You can click me'); return false; })();return false;">
your text goes here click here</a>
</div>
</td>
This worked for me. Thank you for the help! Appreciate it.
<div class="container" style="position:relative;text-align:center;color:white;" >
<img class="img-responsive" src="https://placeimg.com/640/480/any" alt="#" style="width:1880px;height:250px;" >
<div class="centered" style="position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);" >Example Text</div>
</div>
Amazon has a facility that generates HTML snippets for you to show images of products from their store.
However when running locally the image is not displayed, when run on jsbin it is.
The local code is:
<img border="0" src="//ws-eu.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=0789722569&Format=_SL160_&ID=AsinImage&MarketPlace=GB&ServiceVersion=20070822&WS=1&tag=valuehistor0e-21"><img src="https://ir-uk.amazon-adsystem.com/e/ir?t=valuehistor0e-21&l=li2&o=2&a=0789722569"
width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
The JSBIN example is here.
You don't state how you run the page: locally from file or via a local server.
In the former case all links with "//*" will adopt the protocol (e.g. "file://") which won't be a valid link.
You can hard-code the protocol instead:
<a href="https://www.amazon.co.uk/Complete-Idiots-Guide-Creating-Page/dp/0789722569/ref=as_li_ss_il?ie=UTF8&qid=1506425682&sr=8-10&keywords=web+development+for+idiots&linkCode=li2&tag=valuehistor0e-21&linkId=fc910756748618e2854e81a581107b24" target="_blank">
<!-- The img src below -->
<img border="0" src="https://ws-eu.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=0789722569&Format=_SL160_&ID=AsinImage&MarketPlace=GB&ServiceVersion=20070822&WS=1&tag=valuehistor0e-21"></a>
<img src="https://ir-uk.amazon-adsystem.com/e/ir?t=valuehistor0e-21&l=li2&o=2&a=0789722569" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
Proper set img src tag in image url.
For example:
<img border="0" src="https://static.pexels.com/photos/248797/pexels-photo-248797.jpeg" width="1000" height="300">
I have created a header for our companies email templates, luckily I was able to find a basic template on the web and tweak it to our requirements.
I am a real beginner when it comes to HTML so I am sure there are many errors in it too.
I need to figure out how to reduce the blue banner to 42px in height but everything I try ruins it. I have also been told that my 600 wide option is very old school and it should be 1200. I have tried to change this too, but then it loses all of the other formatting and looks terrible.
Its supposed to be responsive, if anyone could make any edit suggestions I would be very grateful.
header.txt
header.html
try changing the padding in the td containing the logo/image. To decrease the height of the blue banner, decrease the padiing at top and bottom of the above mentioned table data.
This helps you but another way is to decrease the logos height.
From looking at the codes, there is no specific "height" that is being assigned to the table containers that you can change to specify to 42px. The most that you can do is to remove the "top" and "bottom" padding from the containers inside to make the header's height smaller.
Here's a sample code with the changes. If you notice, I changed the top and bottom padding to 0px. For the second td, I left 5px for the top padding to add some spaces between the logos and the top edge of the screen. If you want to edit the width, I change the width to 800px but you also need to adjust the widths of the 2 containers inside the table. For example, I changed them from 270px to 370px each.
Lastly, I agree that this "template" that you found seems very complex and it would be better to learn a little bit of basic html and css and what you're trying to do is simple and can be done with much simpler codes. Good luck!
<center>
<table cellspacing="0" cellpadding="0" width="800" class="w320">
<tr>
<td valign="top" width="370" style="background:#2980B9;padding:0px 15px 0px 15px;">
<a href="https://www.hayley-group.co.uk/" style="text-decoration:none;">
<img src="http://hosted.hayley-group.co.uk/shop/hayley_web_logo_white(trans).png" width="110" height="auto" alt="Hayley Group PLC Logo"/>
</a>
</td>
<td valign="top" width="370" style="background:#2980B9;padding:5px 15px 0px 15px">
<table border="0" cellpadding="0" cellspacing="0" class="mobile-center-block" align="right">
<tr>
<td align="right">
<a href="https://www.facebook.com/HayleyGroup/">
<img src="http://hosted.hayley-group.co.uk/shop/social_facebook.png" width="30" height="30" alt="social icon"/>
</a>
</td>
<td align="right" style="padding-left:5px">
<a href="https://twitter.com/HayleyGroup">
<img src="http://hosted.hayley-group.co.uk/shop/social_twitter.png" width="30" height="30" alt="social icon"/>
</a>
</td>
<td align="right" style="padding-left:5px">
<a href="https://www.linkedin.com/company/hayley-group">
<img src="http://hosted.hayley-group.co.uk/shop/social_linkedin.png" width="30" height="30" alt="social icon"/>
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
I just started learning how to code up html emails yesterday and I'm having an issue with the image I want to set as the background of my html email that I send.
Here is the code at the top where i have the background image in the first table set.
If I try to add an img src tag in the tr or the td below it, the background shows but it's cut off.
Everything else works (I have buttons as images such as the one labeled "SHOP NOW!" that work fine) except the background image and this is getting frustrating!
<html>
<body>
<table width="600" cellpadding="0" cellspacing="0" border="0" height="711" align="center" background='http://i44.tinypic.com/21edv6q.jpg' style='vertical-align: bottom;'>
<tr>
<td height='588' style='vertical-align: bottom; padding-left: 20px;'>
<a href="http://www.jbn.com/cart/index.php?route=product/categor &path=172_247" target="_blank">
<img src="http://i43.tinypic.com/2ngvebl.jpg" alt="SHOP NOW!" />
</a>
</td>
</tr>
I think you have your image in your body tag
<body background="http://i44.tinypic.com/21edv6q.jpg">
see http://www.w3schools.com/tags/att_body_background.asp
I am not a html programmer but I have to fix an urgent problem. Since this is a private project, I can't post the code here. But here is the obfuscated page source (Note: a href tag is created by Spring Security tag)
<td width="359">
<table style="margin-left:auto; margin-right:8px">
<tbody><tr>
<td>
<img src="/img/Login.gif" alt="Login" height="18" border="0" width="120">
<br>
<br>
<img src="/img/newAct.gif" alt="new account" height="18" border="0" width="120">
</td>
</tr>
</tbody></table>
</td>
Above html code creates a 1 pixel shadow right under the second image. Please see attached picture and red arrow pointing to 1 pixel line.
Thank you for your help in advance!
<img src="..." style="margin-top:0px;">