{"id":583,"date":"2012-04-24T16:40:39","date_gmt":"2012-04-24T16:40:39","guid":{"rendered":"http:\/\/www.sitekickr.com\/blog\/?p=583"},"modified":"2012-04-24T16:40:39","modified_gmt":"2012-04-24T16:40:39","slug":"rounded-corners-form-inputs","status":"publish","type":"post","link":"https:\/\/www.sitekickr.com\/blog\/rounded-corners-form-inputs\/","title":{"rendered":"Rounded corners on form inputs"},"content":{"rendered":"<p>You might be saying &quot;Duh &#8211; just use the CSS 3<em> border-radius<\/em> style&quot;. Or, you might be saying &quot;Who is this guy? Why doesn&#39;t he just use a JavaScript corner rounding script?&quot;.<\/p>\n<p>If you&#39;ve checked out any IE browser before IE 9, you&#39;ve noticed that border-radius doesn&#39;t happen. It&#39;s part of the CSS 3 spec, and hence not supported in IE 8.<\/p>\n<p>I actually can&#39;t speak for all JS corner rounding scripts, there may be a good one out there that does a good job of rounding form elements &quot;out-of-the-box&quot;. But, every one I&#39;ve tested required some tweaks. It&#39;s not form elements per say that cause issue, but inline elements all-together.<\/p>\n<p>So, what do we do when an inline element is giving us slack? Wrap it in in a block-level element!<\/p>\n<p>The following jQuery code leverages the<a href=\"http:\/\/malsup.com\/jquery\/corner\/\"> jquery.corner.js plugin<\/a>.<\/p>\n<p><code>$(&#39;input[type!=file], select, textarea&#39;).wrap(&#39;&lt;div class=&quot;text-input&quot; \/&gt;&#39;).css(&#39;border&#39;, &#39;0&#39;).css(&#39;background&#39;, &#39;none&#39;);<br \/>\n\t$(&#39;.text-input&#39;).wrap(&#39;&lt;div class=&quot;text-input-wrapper&quot; \/&gt;&#39;);<br \/>\n\t$(&#39;.field .text-input&#39;).corner(&quot;round 5px&quot;).parent().corner(&#39;round 5px&#39;);<br \/>\n\t<\/code><\/p>\n<p>CSS<\/p>\n<p><code>.text-input { background: #fff; }<br \/>\n\t.text-input-wrapper { padding: 1px; background: #888; } \/* the background color will actually be the border color *\/<br \/>\n\t<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You might be saying &quot;Duh &#8211; just use the CSS 3 border-radius style&quot;. Or, you might be saying &quot;Who is this guy? Why doesn&#39;t he&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"amp_status":""},"categories":[12,5],"tags":[37],"_links":{"self":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/583"}],"collection":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/comments?post=583"}],"version-history":[{"count":1,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/583\/revisions"}],"predecessor-version":[{"id":584,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/583\/revisions\/584"}],"wp:attachment":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/media?parent=583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/categories?post=583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/tags?post=583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}