How do i keep this from showing up on my images on mouse over?
[IMG][/IMG]
because i noticed that some show up and some dont.
How do i keep this from showing up on my images on mouse over?
[IMG][/IMG]
because i noticed that some show up and some dont.
Short take: that small overlay is caused by how the browser is being given the image. noticed the behavior and hinted at the obvious workaround (wrap the image in HTML). Below are two practical, server-side approaches that avoid making lots of static pages and give predictable user experience.
A lightweight single-file viewer (recommended)
Use one dynamic viewer page that sanitizes the filename and renders the picture inside an HTML wrapper (so the browser never opens the raw image URL). That lets you add UI (caption, download button, lightbox) and avoids the overlay without creating many files.
<?php
// view.php?img=filename.jpg
$img = basename($_GET['img']); // basic sanitize
$path = __DIR__ . '/images/' . $img;
if (!is_file($path)) { http_response_code(404); exit; }
?>
<!doctype html>
<html><head><meta charset="utf-8"><title>Image</title></head>
<body style="margin:0">
<div style="width:100vw;height:100vh;background:url('/images/<?php echo rawurlencode($img); ?>') center/contain no-repeat;"></div>
</body></html> Force download (different UX)
If you want the file to download instead of display (so no overlay), send a Content-Disposition header. Example for Apache (.htaccess) or a small script that sets Content-Disposition: attachment and streams the file. This changes the user experience — they get a download dialog.
<IfModule mod_headers.c>
<FilesMatch "\.(?i:gif|jpe?g|png)$">
Header set Content-Disposition "attachment"
</FilesMatch>
</IfModule> Notes and cautions
Jump to Post— Member #114696its shown when you open a image file with browser. well its a browser feature there's no way to stop that i suppose.
Jump to Post— Dani 5,664Stop using Internet Explorer :)
its shown when you open a image file with browser. well its a browser feature there's no way to stop that i suppose.
thanx
Stop using Internet Explorer :)
I dont like MSIE, i just use it because most people use it, and i can see how there seeing my page.
it should only show up if you access an image file by a direct URL to the image itself: , you get a funny lil square with some arrows and a "thing" in the opposite corner aswell.
that's MSIE's standard way of dealing with image-type responses. Would you rather it attempted to download the image instead? =P
...So... to get rid of it... make loads of HTML pages with just <img> tags ^_-
.....make loads of HTML pages with just <img> tags ^_-
What exactlt do you mean?
What exactlt do you mean?
He means that instead of making links for images make several html files which have img tags for your images and thus it wont show that save buttons.
Well the idea is not bad if you use it woth a bit of Javascript or any other language. So you will not have to make several html pages.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.