开发者

CSS: can I hide the borders of the searchbox?

开发者 https://www.devze.com 2022-12-28 05:53 出处:网络
Can I hide the borders of the searchbox ? I would like it completely white, just the text should be visible.And I need a solution for all browsers.

Can I hide the borders of the searchbox ? I would like it completely white, just the text should be visible. And I need a solution for all browsers.

See the picture: http://dl.dropbox.c开发者_运维问答om/u/72686/searchBox.png


you can add this

<input name="textfield" type="text" class="hide_border" id="textfield" />

css

.hide_border{
    border:none;
    *border:solid 1px #FFF;
}


By using a standard checkbox I am not sure whether you get this effect in a cross browser way. You can use a custom element and make it act like a checkbox using CSS and javascript.

See this one which uses jquery

Fancy custom radio and checkbox


I'm not sure if I understand correctly. Why don't you just hide the checkbox and leave the label ? (Later using javascript and such you can redisplay the checkbox)


Checkboxes can not be styled in all browsers. The common solution is to use two images, toggling between the two when clicked (and updating a hidden field as necessary).


<style>
.inputsearch input
{
   background-color: #FFF;
    border: none;
}
</style>


<div class="inputsearch" style="text-align:left;">
  <input type="text" value="HEy there ">
</div>


Styling checkboxes isn't doable in a crossbrowser fashion without some jQuery, have a look at this: Custom checkboxes with jQuery. It's the only way to do it, standard checkboxes cannot be styled in all browsers.

0

精彩评论

暂无评论...
验证码 换一张
取 消