Creating an input element with a dotted border
13,985
Solution 1
This is the code I came up with:
HTML
<input type="text" id="dotted">
CSS
#dotted {
border:0;
border-bottom: 2px dotted;
}
Here is a jsfiddle.
Solution 2
HTML:
<input type="text" class="dotted-input">
CSS:
.dotted-input {
border: 0px;
border-bottom:1px dotted #000;
}
Solution 3
Here's one
<input type="text" class="dotbox">
.dotbox{
border:none;
border-bottom:thin dashed black;
padding-bottom:0;
outline:none;
}
Author by
murtaza52
I am a clojure enthusiast working out from Pune, India.
Updated on June 04, 2022Comments
-
murtaza52 almost 2 years
I want to place an input element in a form. However, instead of it having a solid-box border, I want it to have a dotted border.
This is similar to what basecamp has for inviting new people to existing projects.
Any ideas how to do that?
-
murtaza52 over 11 yearsI am unable to get the above style working. I am using twitter bootstrap, could that be overriding the styles you have provided above ?
-
Sean Keating over 11 yearsIt would be likely they would use this on multiple input fields, so a class would me more appropriate than an Id.
-
Shiridish over 11 yearsYes may be there is some
CSS specificity
issue there. Do you find the above css overridden with existing css in Firebug or developer tools?