chromedude
chromedude

Reputation: 4302

Get rid of the borders on an <input> box

I have the below HTML. I would like to make this so that it is just a white space without borders. I tried removing borders with CSS like this: #search-box {border: none;} but that did not work. Any thoughts?

Here is the HTML that it is in:

<div id="topNav">

<span class="topNavLink" id="headingTitle" >Word 4 Word</span>

<span id="topNav1two">
<a href="#" id="home" class="topNavLink">Home</a>
<a href="#" id="new" class="topNavLink">New Test</a>
</span>
<span>
<input type="search" size="35" id="searchInput"><!--this is the search box-->
<input type="button" value="Search" id="searchBttn">
</span>

<span>
<a id="feedback" target="_blank" class="topNavLink">Help</a>

<a href="#" id="settings" class="topNavLink">Settings</a>

</span>


</div>

And here is the relevant CSS:

/*Deals with the top nav*/

#topNav {
          padding-top: 10px;
          padding-bottom: 10px;
          background: black;
          position: absolute;
          top: 0;
          left: 0;
          width: 100%;
        }

.topNavLink {
              text-decoration: none;
              color: orange;
              padding-left: 10px;
              padding-right: 10px; 
            }

#headingTitle {
                font-size: 1.3em;
              }

/* ends top nav */

/* Deals with the search bar */

#searchBttn {
              height: 25px;
            }

#searchInput{ 
              border: none; 
              background: black;
            }

/* ends the search bar */

Upvotes: 4

Views: 7276

Answers (3)

Florie
Florie

Reputation: 351

border: none can be used with input[type="text"], like so:

input[type="text"] {
  border: none;
}

Upvotes: 0

Phil.Wheeler
Phil.Wheeler

Reputation: 16858

I'd suggest you try setting:

#search-box { border: 1px solid transparent; }

Failing that, try forcing the issue with this:

#search-box { border: 0; }

Upvotes: 6

Michael Haren
Michael Haren

Reputation: 108376

That works for me (Chrome9 on Win7). What browser are you using? Maybe post more of your code?

Upvotes: 3

Related Questions