scvinodkumar Posted September 20, 2008 Share Posted September 20, 2008 Hi there, i have the following code after the </html> tag <div align="center"><img style="margin-top: 2px" border="0" width="106" height="23" src="test.png" alt="test image"></div> Please tell me how to hide this image. Quote Link to comment https://forums.phpfreaks.com/topic/125047-how-to-hide-the-image-tag/ Share on other sites More sharing options...
dropfaith Posted September 20, 2008 Share Posted September 20, 2008 <div align="center" style="display:none;"><img style="margin-top: 2px" border="0" width="106" height="23" src="test.png" alt="test image"></div> Quote Link to comment https://forums.phpfreaks.com/topic/125047-how-to-hide-the-image-tag/#findComment-646266 Share on other sites More sharing options...
scvinodkumar Posted September 20, 2008 Author Share Posted September 20, 2008 thanks for your reply,but i need to hide this through css page. there is no class name or id. is it possible to do? Quote Link to comment https://forums.phpfreaks.com/topic/125047-how-to-hide-the-image-tag/#findComment-646275 Share on other sites More sharing options...
dropfaith Posted September 20, 2008 Share Posted September 20, 2008 uhmm add a class to it i dont see why it isnt classed if your using an external style sheet Quote Link to comment https://forums.phpfreaks.com/topic/125047-how-to-hide-the-image-tag/#findComment-646278 Share on other sites More sharing options...
F1Fan Posted September 21, 2008 Share Posted September 21, 2008 If you're trying to hide it and show it, you could use JavaScript. <script type="text/javascript> function hideImage(imageId){ document.getElementById(imageId).style.display = "none"; } function showImage(imageId){ document.getElementById(imageId).style.display = "block"; } // Or use one function to do both function showHideImage(imageId){ if (document.getElementById(imageId).style.display=="none"){ document.getElementById(imageId).style.display = "block"; } else{ document.getElementById(imageId).style.display = "none"; } } </script> Quote Link to comment https://forums.phpfreaks.com/topic/125047-how-to-hide-the-image-tag/#findComment-646849 Share on other sites More sharing options...
JasonLewis Posted September 21, 2008 Share Posted September 21, 2008 If you want to hide all images, which is weird, you can do the following: <style type="text/css"> img { display:none; } </style> Quote Link to comment https://forums.phpfreaks.com/topic/125047-how-to-hide-the-image-tag/#findComment-646881 Share on other sites More sharing options...
haku Posted September 21, 2008 Share Posted September 21, 2008 regardless of how you hide it, you have to move it inside the html and body tags, or your code will throw an error. Quote Link to comment https://forums.phpfreaks.com/topic/125047-how-to-hide-the-image-tag/#findComment-646926 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.