html - How can I hide an element with css while still keeping it on the page? -



html - How can I hide an element with css while still keeping it on the page? -

i trying hide element on page still want there. want button still can clicked want invisible.

there 3 ways hidden elements , maintain page position. can more info between normal flow , css style(ie: opcity, visibility) attribute relation.

visibility opcity transparent

class="snippet-code-js lang-js prettyprint-override">$('div').click(function (){ alert(this.innerhtml) }) class="snippet-code-css lang-css prettyprint-override">div{ border: 1px solid #000; } .one{ visibility:hidden; } .two{ opacity: 0; } .three{ background: transparent; color: transparent; } class="snippet-code-html lang-html prettyprint-override"><!doctype html> <html> <head> <script src="//code.jquery.com/jquery-2.1.1.min.js"></script> <meta charset="utf-8"> <title>js bin</title> </head> <body> 1 <div class="one">visibility</div> 2 <div class="two">opticy</div> 3 <div class="three">transparent</div> 4 </body> </html>

html css

Comments

Popular posts from this blog

Using Android Volley to post an array to PHP -

python - How to add an model instance to a django queryset? -

angularjs - No 'Access-Control-Allow-Origin' error from local domain to public API -