Today I worked on a template for another client and run into some strange bug. Well not really a bug, but more of an annoyance that took ten minutes to fix. In the lower part of a site near the commenting box two rectangle border showed up. Obviously this was caused by the input field and its CSS.
Here is the old css (excerpt)
input { border: 1px solid rgb(204, 204, 204); padding: 3px 6px; background: rgb(255, 255, 255) none repeat; color: rgb(102, 102, 102); }
and here a quick screencap of what the problem looked like:

I applied this quick CSS hack to my code to make the border disappear:
input[type="hidden"] { border: 0; padding: 0; margin: 0; background: white; }
(marked green in screencap)

Voila, the rectangles are gone. No more annoying borders around hidden input fields with CSS.

I hope this helped anyone. You can do a similar trick with the input property “submit” if you want to apply different CSS attributes to your input submit form only.
If you enjoyed this post, make sure you subscribe to my RSS feed!

h4x3d.com does not host any illegal content. Links/Files referred to are for educational purposes only.




2
December 6, 20089:47 pm
December 6th, 2008 9:47 pm
Chillstar
Thanks a lot for this- came up top with my search on Google and helped me out quickly and easily. Been coding CSS sites for over 5 years now, but never used a css style like this. Good to know- will keep this in my css arsenal.
Cheers from the UK.
4
December 8, 200810:18 am
December 8th, 2008 10:18 am
jez
@Chillstar: welcome mate, best greetings from London, UK