Jump to content

Block image display


wmckinn
 Share

Recommended Posts

I don't know if this is possible or not - can CSS be used to completely block the display of all images (or other file types) on a web page? I want to set up a stylesheet for my browser to use (Internet Explorer). In my personlized stylesheet, I'd like to keep image files from being displayed. My efforts have failed thus far. Any advice would be helpful.I was wondering if wildcards are supported in CSS - obviously I won't know the exact file names to block; only file types. I'm playing around with this in an effort to block banner ads, Flash ads, etc.Thanks!Walt

Link to comment
Share on other sites

Are you talking about actually using display:block; or wanting to a make the images not appear from the page?If you're talking about the first then the following code will block all images on your page. If you want to only select a number of images, then use classes.

<style type="text/css">img {  display: block;}</style>

If you're talking about the second, then you can do:

<style type="text/css">img {  display: none;}</style>
Link to comment
Share on other sites

Are you talking about actually using display:block; or wanting to a make the images not appear from the page?If you're talking about the first then the following code will block all images on your page. If you want to only select a number of images, then use classes.
<style type="text/css">img {  display: block;}</style>

If you're talking about the second, then you can do:

<style type="text/css">img {  display: none;}</style>
Thank you! The 'display none' code worked. Do you know of a similar way to prevent Flash files from being displayed?I have just answered my own question. I tried using 'object none' in the CSS and that effectively kills the Flash files.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...