Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide something with CSS without display:none or JavaScript

Tags:

How can I hide the div without using display:none or JavaScript?

In my country, a lot of Blackberrys come with the CSS support disabled (the mobile companies here are not so good to developers). I have text that says

<div class="BBwarn">
please activate your css support and a link
</div>

I want to hide that once the user activates CSS support, but i can't use display:none; because it is only supported in BB firmware 4.6. It is a public site and I can't make all my visitors upgrade.

Does anybody knows a solution to this? I hope the question is easier to understand now.

Update: Thank you all for the answers but I can't use

  • position:absolute
  • overflow

because they are available from Blackberry firmware 4.6 and up

like image 386
rblanch Avatar asked Dec 12 '08 16:12

rblanch


People also ask

How do you hide things in CSS?

You can hide an element in CSS using the CSS properties display: none or visibility: hidden. display: none removes the entire element from the page and mat affect the layout of the page. visibility: hidden hides the element while keeping the space the same.

How do I completely hide an element in CSS?

Completely hiding elements can be done in 3 ways: via the CSS property display , e.g. display: none; via the CSS property visibility , e.g. visibility: hidden; via the HTML5 attribute hidden , e.g. <span hidden>

How do you hide an element in CSS without taking space?

Look, instead of using visibility: hidden; use display: none; . The first option will hide but still takes space and the second option will hide and doesn't take any space.


1 Answers

This is a common way:

margin-left: -9999;

like image 122
krusty.ar Avatar answered Sep 19 '22 06:09

krusty.ar