HTML & CSS
Okay, forgot something I used to know...
How do I add a PDF file (newsletter) to my website. I tried the <a href="images/xnndnd.pdf" but that apparently is wrong.
Yes, you just need to create a link and make sure it points to the right location and file. So this—
<a href="images/xnndnd.pdf">View PDF</a>
—will work if:
- the pdf is in your images folder
- the images folder is in the same folder as the page the link appears on
- the name of the PDF file is xnndnd.pdf
It's generally easier to put your images folder in the main site folder (the 'root folder', where your home page is) and then link to the images folder from any page on the site with
<a href="<font color='"#FF0000"'>/</font>images/xnndnd.pdf">View PDF</a>
Then you don't have to worry about the location of your page in relation to the location of the images folder.
So why doesn't this work?
<center><a href="images/Midwest.pdf" height="200" width="200"></center>
You have an incomplete link there. You need some text for the link to appear, something like this:
<center><a href="images/Midwest.pdf"><font color='"#FF0000"'>View PDF</a></font></center>
You don't put width and height on an <a>, just on an image. So if you want people to click on an image rather than a text link, you'd need to create an image of your PDF (you could take a screen shot, for example) and then use code like this:
<img src="images/pdf-pic" width="200" height="200">
So the link point to the pdf, which will open the pdf when they click on it, but what the user sees before hand is an image of the PDF.
You can't just have an empty link like <a href="">. Look at the code for any links on your site. None of them are empty like that. You need a closing </a> tag, with text in between that becomes the linked text. Images are different in this respect.
This topic is now closed. New replies are no longer allowed.