Julian Klewes

Want no border around input hidden field with css?

Tagged

Categorized
Dated 2 years ago






Times read: 767
Read today: 4
Read last: March 21, 2010

Want no border around input hidden field with css?

popup tail

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:
border-hidden.gif

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)
border-hidden-css.gif

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

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.


People asked me to put up a donate button or something similar, so here it is: if you care to buy me a beer or Red Bull (I drink the Dutch equivalent called Spam Energy), feel free to donate, anything is appreciated!



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

Interact - Leave a comment

Engage in the conversion and leave a comment.
I would much love to hear from you. Please note however that comments are moderated by default. Advertising and rant is welcomed, yet often discarded...
See left/right for additional information













2

1 year ago
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

1 year ago
December 8th, 2008 10:18 am

jez

@Chillstar: welcome mate, best greetings from London, UK

comment? jump to the form



archives | sitemap
contact | tos

Top

lorem

solarVPS.com - reliale enterprise hosting
you know the game, get in touch with me
3