Open HTML Embedded in iOS With Relative Background Image - html

I have an app that will occasionally open up HTML pages that are embedded in the app. What I want to know is how to code the HTML to put the background.
Right now the HTML code I have is:
<body background="file:///New Macintosh HD/Users/UserName/Desktop/light-wood-texture.jpg">
But again, that is for a local file on my desktop, just need to know how to format it for the iPhone app, as the HTML and image will be embedded in the app itself.

It depends on where the image is. If it is in the same directory as the code in which you are referencing, I believe you can just do this:
<body background="/light-wood-texture.jpg">

Related

Images in HTML file not being displayed on iPhone

I made some simple HTML files and tried to open them on my iPhone, in both the files app and some third party HTML viewer apps from the App Store, but the images are not being displayed, not a single one.
It‘s not because the image is in another folder or the file path is incorrect, I‘ve checked all that. Also I‘ve looked up the issue and it seems that this might be caused by too large png files, but I tried to resize the images and also changing them to jpg, but still didn‘t work. So what could be the issue here?
I‘ve attached an image of the result that I get with this example code (the png file is in the same folder as the HTML file):
<html>
<head>
</head>
<body>
Test
<br>
<br>
<img src="image.png">
</body>
</html>
Result
This is almost certainly a security related issue.
I ran into this helping a friend who was working on an email newsletter and sent it to herself as an attachment. Opening in gmail showed the same behavior - no images.
So I tried saving the file to the Files app and opening it. Same thing. Loading the page from a web server it worked n
It doesn’t entirely make sense why they need to be so strict - the same thing in a desktop browser would show images. But I don’t think there’s anything you can do in this case.
Saving as a complete web page archive may work if the goal is to email an attachment that someone needs to open - but that’s not a common thing to do and if you send the message as a real email it’ll work fine.

my web pages are not opening until I turn vs code live server how can i fix it?

I really want someone to help me I have a serious issue with vs code live server everything is perfectly working but once I completed my project I can't open my web pages without turning the live server on, whenever I want to check my web pages I have to open it in the vs code then turn on the live server is there a way I can fix it I want to open web page directly rather first open it in vs code than turn on the live server...
Go to your folder where you have saved html file and then double click the html file so it will be be opened as a html document in your browser
Try to be more specific. What do you mean by "opening directly"? Do you mean double clicking the html-file? What are you coding? Only html/css or js with libraries?
What happens if you double click the html file?
Browser opens the html:
Does it open the browser and shows a page without styling? If you don't see your css applied you might have added a prepending slash to your css link. Change your css link to something similar as this (the path should point to your css file):
<link rel="stylesheet" href="css/style.css">
Note: their is no prepending slash in the href attribute value. A prepending slash will work in a live server environment but will fail when the browser reads the file locally (= double clicking).
Browser does not open html:
If your browser does not open when double clicking the html file your browser is not configured as the program to launch html files. You could instead drag your html file into an open browser window. And look on the internet how to change your settings to launch your favorite browser when double clicking html files.

ASP.NET Razor VB.NET - Uploaded Images are upside-down. How to fix?

I have an ASP.NET Webpages Razor syntax VB.NET Website.
I have recently added in the feature to upload images with great success.
However when viewing the image on the website any picture is upside-down!
The original files are of the correct orientation however upon viewing through the website using the <img> tags I get the issue.
I have one other static image in my site and this is not flipped. It is only the files that I upload. Even files downloaded from the internet and uploaded come out on the page as upside down!
So right now I am using:
<img src="/Docs/Events/1676/image1.JPG" height="400" width="400">
Using developer tools through chrome I can request the image directly. This shows the image correctly!
Any suggestions how I can fix this?
Thank you

iOS - HTML source is different than when inspecting element in Chrome on desktop

I am trying to get the html of a website to put in my iOS app. When I log the html from an NSData variable through an NSURLConnection, the html is different if I then went to the website on my desktop and clicked inspect element on the element that I am trying to find in the iOS html. Why would it be different? Is it because I clicked specifically on that element? It looks the same on iOS and the desktop because I have it loaded into a UIWebView.
Update: I have been told that in Chrome it is the rendered source code. How can I get the rendered source code in iOS?
In Chrome's Developer Console, it's showing rendered source codes (after AJAX and extension's modifications). Code mistakes (such as unclosed tags) will be fixed too.
It's NOT your original source code.

image is not showing on html page

I am new in Ubuntu, as well as using lampp, My problem is, after storing image in image folder of my apps, image is not showing in HTML file ( image not found ). localhost document root is /opt/lampp/htdocs/, and my root folder is f_21 if I use the following link
http://localhost/f_21/index.html // not works
But image showing works well if I use following link:
file:///opt/lampp/htdocs/f_21/index.html // but it works
Any idea ??
You should keep both image and index.html files under htdocs.
for you,place your index.html and image files under f_21 folder and update src attribute of img tag in your index.html
If the link to the image is an absolute path based on your file system with the file protocol, then you won't be able to load it when viewing the html page over http.
Chrome doesn't (I'm not sure about other browsers) allow loading local resources on a file requested with http.
If you're using chrome, you can press ctrl+shift+j to see the console, which will show any errors. You might see something like: Not allowed to load local resource.
The solution is to change the src of the image to be relative to the html page it's on.