Playing a .gif file with html - html

i started yesterday with html and I have issue. Everytime I try to open it in the website it shows just a black thing. This is the code:
<img src="Users\mkotz\OneDrive\Desktop\Eternity.gif"height="450"width="150"
loop="true"
autoplay="true">

Everything seems to be alright with the code but the path you are referring to might be invalid. You should be considering using a path referring to the website and further its files.
In web development you should folder all your files something like this:
Add your image files always to the resources folder. Then you can refer to it from the index.html by saying src="./resources/<image_name>.gif" and so on.

The link is probably invalid, Check that and try again.

Related

HTML audio tag play button is greyed out on Django project

For some reason the play button is greyed out on my Django website. I used this same exact HTML code in a blank HTML document and it worked as it should, so I don't think there's a problem finding the file, or a syntax error. While running the server locally I am not seeing any errors in the command line either.
How it looks on blank HTML file
How it looks on website
Code:
<audio src="C:\Users\zach2\music\download.mp3" controls>
</audio>
Is there something that I need to change in one of the Django files to enable audio to work properly? I am very new to Django and Web development.
You can put the file inside your server root (within a media or assets directory) instead of trying to load it directly from that path.
Local files are generally not accessible to a browser for security reasons. Else any website would be able to access your sensitive files just by guessing and putting in the most common paths.
One thing is you cannot access local on hosted website may it be local or remote files, unless you are using blank HTML page just like you did. This is because of a security concerns.
If you do want to server your media files such as audio, images, videos, etc. normally you can put it inside media folder inside your django app directory if you are handling with user uplodaded files or any non-static files.
To handle staticfiles and mediafiles in django you can refer to this link https://docs.djangoproject.com/en/3.2/howto/static-files/

Chrome not rendering HTML content?

for some reason my HTML is not rendering in chrome. For some reason, I am getting an odd webpage with just the IP Adress. I am not sure if it is something related to the server. Can anyone assist?
VSCode starts the live-server in your project directory, and that's essentially what you're seeing in your browser.
Just move the HTML file into this directory (folder) and try running the server again, preferably your cursor clicked in the HTML file.
Switch the name to index.html , that should help.

HTML5 download attribute not changing filename

I'm having issues with the download attribute and overwriting the filename. Currently when I set a value for the download attribute it is not taking affect. I believe this as something to do with the specific file I am referencing as it works for other files, but I'm not sure exactly what is causing the issue or how to resolve.
In the below code the filename does not get overridden. (I stole the code straight from W3Schools to keep the example very basic and to ensure nothing I am doing is creating the issue.)
Additional, the download only works in Chrome. If you try in Firefox it opens the file to play the video (which is another issue that I need to resolve).
<a href="https://cameratag.com/videos/v-c1e97800-8f2b-0132-12e6-22000a8c0328/qvga/mp4.mp4" download="w3logo22">
<img border="0" src="/images/myw3schoolsimage.jpg" alt="W3Schools" width="104" height="142">
</a>
Resolved, I contacted the content provider and determined the issue is due to the fact the assets URLs are actually redirects to a signed URL on their CDN.

Favicon Not Showing Up?

Any idea why this isn't working?
<link rel="icon" type="image/png" href="Favicon.png"/>
It's just not showing up. I used the exact same setup on a local practice website, and it worked fine (it was using the same picture as well). Are you supposed to just put the picture onto your website server and reference it like I did? Or is there something I don't know about?
Also, how exactly do you get a favicon to show up on IE? Yes, I've researched this, and all the methods I've found just don't work...
You can just put the icon [favicon.ico] in the root directory of your website. That's what I did.
Oh yeah, to answer the question, it could be because it is a png ;)
There is a PNG to ICO file converter online, so that's what I used to get around the IE issue. www.convertico.com
*If you test this locally, it might not show up. My local pages don't show a favicon.
Yes, you should upload the file to your web server. The reason why this works locally for you is because it is in the same file as your html document. There are two things you do to get your favicon working:
Upload the file to the same folder as in your html document. If you have a web host, such as altervista.org, you could upload your favicon to the website.
Upload your favicon to an image uploading website. You could use google drive for all it's worth, anything website that can publicly display your photos is fine. If you upload this to a server, you can find the link to your image and reference that favicon in your link tag.
Hopefully this helps!
I faced to the same problem.After checking my whole code for hours , finally I figured out the problem.I used base tag , it caused the favicon icon to do not be displayed.When I removed , the problem was solved.So, I recommend you to remove base tag if you have used in your website.
I hope it could help!

Trying to open a .pdf file in an iframe

I am really having a hard time opening up certain .pdf files within an iframe HTML element. I can open some .pdf files in this iframe, but not all of them. The ones that I cannot open were created by the Crystal Reports engine in Visual Studio 2010.
My source is simple and looks like the following:
<iframe src= "c:\jnk\EULA.pdf">
</iframe>
Is there any characteristic of a .pdf file that could prevent it from being displayed in an iframe? I am using IE8, but get the same results in FF. I also can perfectly display this .pdf file when it is not in an iframe.
IFrame isn't correct solution. You can use other solutions :
1 . <embed src="file:///C:\jnk\EULA.pdf" width="500" height="375">
2 . Download this library and use it.
I hope that I helped.
PS
Remember that when we use local file, we should write in prefix file:///
Sorry for my English
Based on a comment of yours, it sounds like your issue is one of permissions, unrelated to PDFs.
If I were you, I'd make sure that I can access the PDFs in my browser outside of any HTML. If that fails, you know you have a problem.