HTML - Load images like the web browser normally does - html

Is it possible to load an image in HTML and load it like an actual image (Like if it was an image/png mimetype etcetera).
Example:
This is me loading an HTML document that contains <img src="RL_Dark.png">:
Loading the image through an HTML document
But here's me loading it directly from the file:
Loading the image through file
Is it even possible to let the browser handle the image loading as I am not planning on doing anything via the HTML document that would be shown to the user (Statistic collection such as Google Analytics and Alexa Analytics), if it is, would anyone be able to show me an example?

Your browser (presumably chrome) when given the direct image url, loads the image in a gallery style view (where it applies centering and shows checkerboarding) whereas when given an HTML page, chrome shows a rendered HTML page. Chrome (and other browsers) often have built in UIs for handling different types of files (another instance would be music files)

Related

How to embed HTML into HTML (with auto-sizing) when loading it from local disk? (file:///)

I am trying to embed one or more HTML files into a "main" overview file, while the embedded content shall be sized appropriately and should avoid the use of scrollbars. (E.g. iframe needs a size in px for height and width, whereas my content varies in size)
All of the files are located on the local drive of the computer and are not intended for web servers. (The files are sort of log files for a software component.)
Already been through the following ideas:
Use javascript to resize the iframe according to content. Unfortunately the browsers (so far Chrome and Firefox was tested) do not allow javascript operations as they are declared cross-site-scripting when using file:/// as the URI
Use of the HTML link tag. The content does not show.
Use of the HTML embed tag. The content does not resize automatically.

CSS not rendered correctly on page load/reload

I'm trying to apply my CSS-file to my webpage.
When I load my website, I shortly see the site rendered correctly (with my CSS-styles applied), while the page is still loaded. When the page finished loading some of the styles I defined with CSS dissappear, for example the background-color or the alignment of some texts. Sometimes when I reload the page the site is rendered normally without me changing the browser or the code. I allready tried deleting the browser cache but nothing changed. I use Google Chrome. I can see that the CSS-file must be loaded correctly, as some of the styles are applied, and the page reneders correctly while the loading processes.
This is an image of my site while loading:
This is an image of my site after loading:
Thanks for your help.
It seems like some other css or js file is loaded after your css file. please provide a link to your page or post the html.
If you use the development tools (F12) you could interspect the Network tab. here you can see whitch files are loaded and in witch order they are

How to view PDF or DOC file in Browser without <iframe> tag

I am using HTML with JSF application in my project and also used ClickJack filter option. First I try iFrame, Object, embed for view pdf portion. I refer path in tomcat folder
<iframe src="/path/file.pdf"/>
at the time browser to show error message is To help protect the security of information you enter into this website,
the publisher of this content does not allow it to be displayed in a frame..
So I need any other way to display pdf or doc file in browser is possible?
Chrome, Edge, and other modern browsers can read PDF files within the browser natively. If you use a link like so:
My PDF
It should open a window like this:

How can I save a web page with embedded images

I know how to embed images in a web page inline. That's not my question.
My question is for a web page that has images included the normal way, as links to a distinct jpg file, how can I save it where it creates a single html file where the images are converted to embedded images inline in the html?
You can use SingleFile for this (I'm the author). It can be run as an extension or from the command line, more info here: https://github.com/gildas-lormeau/SingleFile.
Not a direct answer, but you may consider the MHTML format (https://en.wikipedia.org/wiki/MHTML), supported natively by IE, but also available in other browsers via plugins.

Tips for progressive rendering of HTML from locally loaded file?

We're using the customer's default browser to display locally generated HTML files in a preview mode. The files are between 0.5M and 2.5M in size. These files do not progressively render in any of the top 5 Windows browsers (Chrome, FireFox, IE, Opera, and Safari). In other words, when we try to load these files, the browser window displays a blank white page until the page is fully loaded.
The HTML files we generate have no tables or script and have all CSS references in the head section of the HTML file. Our pages include about 10 unique 16x16 png images (with image height and width explicitly included on each img tag) that are referenced several hundred times. Our output validates 100% compliant with XHTML 1.0 Strict using the W3C validation service.
Any tips on how we can enable progressive rendering of LOCALLY loaded HTML files or is progressive rendering a feature that is disabled for locally loaded files?
As an alternative, I'm looking for any tips that would allow us to display a GIF busy indicator graphic while the rest of the file loads and is rendered. We tried doing this by placing a GIF image at the top of our HTML file (immediately following the open body tag) followed by a div with display:none styling that included the full content of the HTML we want rendered. Unfortunately, the GIF file does not display until the full HTML file is loaded.
Thank you,
Malcolm
I can suggest that you confirm that the content is being interpreted properly by the browser. Despite the W3C checks, things could still be handled in 'quirks mode' .. In my experience, 'xhtml-transitional' has proved to be the most likely to provide cross-browser zen. Also, confirm that major tags like 'div' and 'p' are being closed quickly. It's hard for the browser to know what to do if the whole page is always in one layer of 'div' ..
Good luck!
Tim