Hide Things From IE with CSS

Computer builds, hardware and software discussion or troubleshooting, including peripherals. Essentially a general place to talk about desktop computers.
Locked
Chris Vogel
Posts: 5140
Joined: Fri Jan 10, 2003 1:14 am

Hide Things From IE with CSS

Post by Chris Vogel »

You can hide things from IE users by using pure CSS. This would come in handy for a little "Congrats! You aren't using IE" message. :roflmao2:

Using this CSS:

Code: Select all

p.classname:before {
content: "Congrats!  You aren't using IE!";
}
[code]

With this HTML:
[code]<p class="classname"> </p>[code]

IE doesn't support the CSS needed to make the content appear, so it just skips right over it.   :biglaugh:  If an IE user really wanted to know what the message says, he or she could just look at the stylesheet though.  

This is IE for Windows that I'm talking about.  I think IE for Mac supports it.  :)  You don't have to do just text either.  You can put an image or anything like that in there if you want.  

Note that you don't have to use paragraphs and you can use ":after" instead of ":before" if you want to.  I just thought I would share this.  :) 

[color=#888888][size=85]Archived topic from Iceteks,  old topic ID:1349, old post ID:11753[/size][/color]
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Hide Things From IE with CSS

Post by Red Squirrel »

haha that's cool. Actually, if you go on my home page with IE, in the bottom it has a link to use a better browser. Try it! :lol:

Archived topic from Iceteks, old topic ID:1349, old post ID:11754
Honk if you love Jesus, text if you want to meet Him!
Chris Vogel
Posts: 5140
Joined: Fri Jan 10, 2003 1:14 am

Hide Things From IE with CSS

Post by Chris Vogel »

Red Squirrel wrote: haha that's cool.  Actually, if you go on my home page with IE, in the bottom it has a link to use a better browser.  Try it! :lol:
HA! I didn't know that! :lol:

Archived topic from Iceteks, old topic ID:1349, old post ID:11755
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Hide Things From IE with CSS

Post by Red Squirrel »

takahita_tsukino wrote:
Red Squirrel wrote: haha that's cool.  Actually, if you go on my home page with IE, in the bottom it has a link to use a better browser.  Try it! :lol:
HA! I didn't know that! :lol:
Did that not too long ago. Figured it would be funny. Sadly, most people still use IE. Most of the log entries have IE as the user agent.

Archived topic from Iceteks, old topic ID:1349, old post ID:11756
Honk if you love Jesus, text if you want to meet Him!
Chris Vogel
Posts: 5140
Joined: Fri Jan 10, 2003 1:14 am

Hide Things From IE with CSS

Post by Chris Vogel »

Red Squirrel wrote:
takahita_tsukino wrote:
Red Squirrel wrote: haha that's cool.  Actually, if you go on my home page with IE, in the bottom it has a link to use a better browser.  Try it! :lol:
HA! I didn't know that! :lol:
Did that not too long ago. Figured it would be funny. Sadly, most people still use IE. Most of the log entries have IE as the user agent.
If I am not mistaken, Opera identifies itself as IE by default.... :unsure: I can also make Mozilla do the same thing, but I forgot how. There's a neat add-on for Firebird, but I don't know if there's one for Mozilla.

Archived topic from Iceteks, old topic ID:1349, old post ID:11758
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Hide Things From IE with CSS

Post by Red Squirrel »

Hmm did not know that about Opera. I knew about mozilla since there's a toolbar you can get for it. Had it once, lost it and never bothered putting it back, I did not use it that much.

Archived topic from Iceteks, old topic ID:1349, old post ID:11761
Honk if you love Jesus, text if you want to meet Him!
wldkos
Posts: 830
Joined: Mon Feb 24, 2003 12:19 pm

Hide Things From IE with CSS

Post by wldkos »

yeah, opera and moz you can change your browser identification.

Archived topic from Iceteks, old topic ID:1349, old post ID:11769
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Hide Things From IE with CSS

Post by Red Squirrel »

wldkos wrote: yeah, opera and moz you can change your browser identification.
You can in IE too. But it's not suppost to be a feature - it's in the registry somewhere, I remember seeing it. :)

Archived topic from Iceteks, old topic ID:1349, old post ID:11771
Honk if you love Jesus, text if you want to meet Him!
megaspaz
Posts: 340
Joined: Wed Dec 18, 2002 10:08 pm

Hide Things From IE with CSS

Post by megaspaz »

konq will let you change your browser id and you're operating system. :P

Archived topic from Iceteks, old topic ID:1349, old post ID:11819
Image
Resistance is futile...

Registered Linux User #321628
Anime/Toon Avatars
Other Cool Forums

"Never hold your farts in. They travel up your spine, into your brain, and that's where you get s**tty ideas from..." - Woyaya - January 10, 2004
User avatar
rovingcowboy
Posts: 1504
Joined: Wed Dec 18, 2002 10:14 pm

Hide Things From IE with CSS

Post by rovingcowboy »

Red Squirrel wrote: You can in IE too. But it's not suppost to be a feature - it's in the registry somewhere, I remember seeing it. :)
but it is needed to be seen as what was downloaded by windows update so you can get the patches needed so going in to the registry and changing it is NOT a good idea :(

Archived topic from Iceteks, old topic ID:1349, old post ID:11957
roving cowboy/ keith
Locked