How can I be doing anything wrong in this code? - html

just starting HTML and I'm at the point of learning . I know that if I put the "index.html" and the img in the same directory, It should be fine to just address the img by name as in ". But when I open the page, all I see is a cracked image. When I look the preview of the page in my file explorer, it just says that "some images where blocked to avoid the sender identifies your computer. Open this item to exibit the images". WHen I try to just source with an URL, it shows up fine, no problems at all, I've tried using alt and not, other browsers as well.
I tried renaming the img file to something simpler to simplify not mistaking the name, tried putting the img and the project (index) file in another directory together, and I was hoping to understand why this which sounds so simple is getting me so many errors.

After searching a bit I came across this hope it helps :)
"Well I think I've fixed it. In control panel>windows defender>options>real-time protection then uncheck scan downloaded files and attachments. After I did this, I could see images on my system use while creating an html page."
link to refer:https://answers.microsoft.com/en-us/windows/forum/all/some-pictures-have-been-blocked-to-helpactually/2aa402d3-0404-44d9-83ce-960258979c07

Related

Why isn't my HTML page loading completely?

I recently started my first HTML project with the help of Youtube. I'm a beginner and only saw the basics of Javascript in college.
Just finished writing my HTML project and wanted to upload it for free using Google Drive and drv.tw.
The only problem is that certain images and icons do not load (irregularly) enter image description hereand/or the pages on the navigation bar take too long to switch.
My question would be, is it because of the free domain or did I do something wrong in HTML?
When I open the HTML file in Safari everything works fine.
Since I'm new to the community, I don't know exactly what and how much I have to upload to get help. So have mercy on me :'D.
To help troubleshoot, use your browsers "developer" (F12) mode. Look at the Network view to see why the images aren't displayed. For example: It might be "not found", "not authorized", or other reasons.
From your comment, it would appear that at times the page is rendering before the images are available to display or something else is limiting image files from being presented at all.
Once we know why the browser can't display the images, then the cause can be addressed.
Post the .html .js and .css code
Please update your question and show the folder structure. It should look something like:
-site-
|
-js
-css
-images
Copy and paste in the code below the folder structure and list the images and their size.
I am not familiar with google drive's capabilities.
It is important to use a web host. There are plenty of free or low cost sites available, so I won't go into it.

What's wrong with this HTML page that I created?

I'm taking a programming class on Lynda.com and I just finished creating this HTML web page, but it's not opening on a web browser. Can someone help me figure out what I did wrong? Thanks! :)
Here's what I did:
Picture
I took a look at your code and it not only looks correct, it displays for me on Chrome, Firefox, Opera, and MS Edge.
I'm thinking that it may be the manner in which you are trying to access the file to display.
Follow these two solutions and see if one of them works for you:
Solution 1) Find where on your hard drive you are saving your "body.html" file. When you find the file, click on it and it should automatically open the file in whatever your default browser is for you.
Solution 2) If you are trying to manually type in the directory address for your "body.html" file inside the web address box of your browser, make sure you are writing the address correctly. Remember, the address is coming from your hard drive and not the internet itself. A format would look something like this:
C:/Website-Projects/body.html
or try:
C://Website-Projects/body.html (***the only difference is the 2 back slashes instead of one).
in the example above, "C" stands for the designation of my hard drive, "Website-Projects" is the name of the folder on my "C drive" that my target file is in, and "body.html" is the target file I'm trying to open within the "Website-Projects" folder.
Give those two solutions a spin and see if that helps.

Save file with different name from original (html)

I want to put a link on html which downloads a file with different filename from original. So for example there is this PNG file:
https://www.google.com/images/srpr/logo11w.png
I would like to put it into html so that when you click to download it, it saves not as "logo11w.png" (which is the original name) but as another name, for example: "Google Logo.png"
I actually had saved the code to do this on my computer and now i have lost access to it and can't seem to find it on google, i tried several search queries. However, I remember it was a pretty short html code (1 line) however I just want to make this possible no matter if you guys give me another code, all that matters is that it works. Thanks!
Faced the same problem today and stumbled upon your question. Here's what I found:
Download logo
You can also achieve the same through javascript, here's the link:
http://www.w3schools.com/jsref/prop_anchor_download.asp

JPG file not loading in webpage

I have a basic webpage that references four image files using the following code:
<img src="/images/SanFran.jpg" name="urbanForm" alt="urbanFormA" width="150" height="100"/>
(I change SanFran.jpg, to London.jpg, NewYork.jpg and Barcelona.jpg - just replacing the filename)
However, although the 4 jpegs are very similar (200 x 150 pixels) and made using a similar technique (cropping an image in Picassa), only one of the files will load (London.jpg). The other three give me a broken link message. I have checked that I am do not have misspellings numerous times, and cannot find the problem.
Is there anything that I have not considered?
(I'm using Aptana Studio on OSX and viewing it using Safari as a previewer; the same problem exists if I look at it using Firefox or Chrome)
Are all the images in the same directory?
Make all the file names lowercase, so you know that isn't the issue.
double check extensions, "jpg or jpeg or JPG or JPEG"
take it back to basics <img src="images/filename.jpg" />
Try naming one of the others
SanFran.jpg. See what happens.
Might give you a clue.
Open them all in windows explorer,
confirm the images themselves load
normally and aren't corrupt.
Check all are in /images/
right click on the broken link and
choose view image or copy image
location. See if where it's trying
to access is definitely the right
place.
Do the same with the working one.
Compare and see if any differences.
change everything to lowercase, just
in case (excuse pun)
hit ctrl+shift+reload a few times,
and F5 a few times.
clear cache manually if you know how
or have the tools.
Copy it to a different loacation and
try loading them there. Ideally a
different computer.
Upload it somewhere and see if it
works in your browser when online
Hopefully one of those may help...
If you know the files are there, make sure the case of the filename matches (s is different than S on Linux), and then make sure .jpg is the proper extension and not .jpeg.
It could be because your Jpegs are saved as CMYK as oppose to RGB. See this link for more detail. However this would only affect some browsers
http://www.plaveb.com/blog/cmyk-images-not-displayed-in-internet-explorer
Open the images in Photoshop and resave in RGB color format (just incase it's CMYK). Known issue in some legacy browsers, not sure when or if it went away.

File:// link doing nothing in all browsers

I have a link being generated that looks like so:
<a target="_blank" title="Test" href="file:///c:/test.xls">Test</a>
This link is inside an iframe.
When I click on it (in any major browser), nothing happens. Fiddler records no traffic.
Pasting the URL into the nav bar works fine - the file download box comes up, and I can download the file no problem.
I've tried every variant of the URL structure (correct and incorrect, colons, slashes, backslashes, etc.) that I can think of.
I'm certain that it's some kind of security restriction, but I can't for the life of me find out what it is or how to get around it. I'm feeling pretty foolish at this point. Any simple explanations?
Sorry, if you are pulling this page off of a server (acessing it as http://), the security settings won't let you link to local content (acess links as file://). I've had this same problem accessing shared .doc files in a wiki. Never came up with a good solution.
Try a colon instead of a pipe ;)