Dynadot โ€” .com Registration $8.99

Help needed - Linking to pdf file

Spaceship Spaceship
Watch
Impact
410
Hi,

I am currently trying to link to a pdf file that is in the same directory as my .htm file but the pdf won't open.

current code:

<a href="bier_stube.pdf" target="_blank"><span class="menu">menu</span></a>

I preview the .htm and I click but nothing happens. I linked to websites without a problem but I can't bring up an internal .pdf file????

EDIT
One other thing, I am new to programming and did not ad "!DOCTYPE....." to the top of my page right away and now after I add it, it shifts my boxes, it changes the size of my boxes and menus? why is that?

thanks

eric
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
if you just try to go to your pdf's link directly (without clicking the link, like www.yoursite.com/bier_stube.pdf), does it load?

also, try removing the span tags to verify that it realyl is the a tag that isn't working. do you have a popup blocker that could somehow be blocking a the link? (since target="_blank" will make it open in a new window)
 
0
•••
if you just try to go to your pdf's link directly (without clicking the link, like www.yoursite.com/bier_stube.pdf), does it load?

also, try removing the span tags to verify that it realyl is the a tag that isn't working. do you have a popup blocker that could somehow be blocking a the link? (since target="_blank" will make it open in a new window)

I think it was because I copy the .htm file to a different computer. The file had all the same pdf's but it just didn't get the connection. But how about the other? Doctype??? it mess up all my css?

THIS IS THE CODE I PASTED IN BEFORE my <html>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
Last edited:
0
•••
Not having a doctype throws most current browsers into "quirks mode", also known as "compatibility mode", meaning they emulate how certain older browsers interpreted pages. One common issue with older browesrs was a buggy implementation of css that rendered the box model incorrectly.

Also, if your code is not proper xhtml, declaring a xhtml doctype on the page can cause errors which may affect browsers ability to interpret your page properly.
 
Last edited:
0
•••
0
•••
use The W3C Markup Validation Service to validate your html to make sure that it's not some validation error that's causing your layout to change.

if you haven't solved the pdf problem, try making the links absolute (using http://www.site.com/file.pdf rather than just file.pdf in the a href)


Thanks everyone. Well I was just on the index (default.htm) page when this happened so the doctype isn't a problem anymore. I am currently learning to code using html.net (not a bad site for learning the basics) and W3Schools Online Web Tutorials (really nice site too).

I have been using notepad like it is going out of style but where I teach part-time gave me the entire adobe suite and I accidently opened my css doc using dreamweaver. I think it is easier to code using notepad because dreamweaver wants to write the code for you and if you not carefull you might think your writing something and dreamweaver puts something totally different. I have found the "Validator" feature on the program pretty useful but I don't understand some of the errors it is thowing out at me. Some of the errors include things like by closing </div> I don't need to </p> because </div> does it for me (something along those lines)????? Another one is I should </span> before </p>??? I don't know...I learn the best from my mistakes so I will continue make them and my site should be pretty good when it is done...hopefully.

I have also found that html.net and w3schools.com taught me from the start to code using xhtml so there was no switch for me to make.

Like I said this is my first website so I have a lot to learn but I really believe I understand the basics of html and my css style sheets. (next up .php and .js) I might be able to learn it using w3schools.com????
 
0
•••
i strongly suggest using w3schools, i learned EVERYTHING back when i was self teaching from there.

if you dont seem to like dreamweaver (i love it, btw - once you get used to it the code colors make the code come to life lol), try notepad++. it's a lightweight programming versatile text editor that has helped me in more than one instance (not to mention it's free).
 
0
•••
Thanks, I have started using it and it is pretty awesome! It makes switching between css and html easy. The validator is cool!
 
0
•••
i wish i could be able to understand you properply but its just that its hard following steps correctly!
 
0
•••
i wish i could be able to understand you properply but its just that its hard following steps correctly!


For html and css? W3schools.com is pretty good but I seriously started with html.net. I found the w3schools.com later.
 
0
•••
Dynadot โ€” .com Registration $8.99Dynadot โ€” .com Registration $8.99
Unstoppable Domains
Domain Recover
DomainEasy โ€” Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back