Link to home
Create AccountLog in
CSS

CSS

--

Questions

--

Followers

Top Experts

Avatar of lirageneve
lirageneve

CSS - Select box and its border.
Hello,
I've been searching for a way to disable the select box (<SELECT>) border. I succeed to remove input text borders using "border: 0px solid;" but it seems it doesn't work with SELECT BOX. If its not possible, I'd like to know if anyone knows a workaround to remove them.

Thanks,
RODRIGO.

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of DaydreamsDaydreams

You cannot change the border of the select box at this time. You can style other aspects of <select>, such as color of the text and background-color, but not the border.

Avatar of seanpowellseanpowell🇨🇦

Well you can change the color - in NS7 and Mozilla - but that's it for now...

Avatar of liragenevelirageneve

ASKER

Isnt there any workaround ?

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


ASKER CERTIFIED SOLUTION
Avatar of seanpowellseanpowell🇨🇦

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Very nice. thanks for your help.

Avatar of seanpowellseanpowell🇨🇦

You're welcome, and best of luck with the project!

Thanks,
seanpowell

You could actually make the border simply 1px solid with the same colour as the bg of the page and the select box.

Even though it would techinically still have a border, it wouldn't appear visibly to have one.

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of seanpowellseanpowell🇨🇦

That won't work I'm afraid... you can't alter the select box border.

melaniejcook, that's why I said this: http:Q_20828322.html#9957719 and seanpowell said that: http:Q_20828322.html#9957989

so, you finally did it? how? the original code has errors ! do you have the code?

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Just thought I'd append this suggestion to this post as I think it's worth considering for anyone that finds this page, as I did, by searching for a solution to the same problem.  This is not 100% perfect and could be tweaked to look better, but the idea is certainly there......

  <div style="position:absolute;top:100px;left:150px;width:400px;height:300px;border-style:solid;border-width:1px;overflow:hidden;">
    <select size="12" style="position:absolute;width:406px;height:310px;top:-4px;left:-3px;">
      <option>This is option 1</option>
      <option>This is option 2</option>
      <option>This is option 3</option>
      <option>This is option 4</option>
      <option>This is option 5</option>
      <option>This is option 6</option>
      <option>This is option 7</option>
      <option>This is option 8</option>
      <option>This is option 9</option>
      <option>This is option 10</option>
      <option>This is option 11</option>
      <option>This is option 12</option>
      <option>This is option 13</option>
      <option>This is option 14</option>
      <option>This is option 15</option>
      <option>This is option 16</option>
      <option>This is option 17</option>
      <option>This is option 18</option>
      <option>This is option 19</option>
      <option>This is option 20</option>
      <option>This is option 21</option>
      <option>This is option 22</option>
      <option>This is option 23</option>
      <option>This is option 24</option>
      <option>This is option 25</option>
      <option>This is option 26</option>
      <option>This is option 27</option>
    </select>
  </div>


Hope this is useful to people.

John.

This is indeed a very good idea. The only problem I find is having different, apriori unknown, heights/widths for the widget. If only they could be specified in %s...

Heh - well we know the answer to that, don't we!  Dreaded JavaScript.

Unfortunately, unless you can specifiy the height and width of the <select>, you're right.  I've not seen anything, other than JavaScript, that will do this.  Also, it obviously doesn't work if it's a drop-down style select.

I think we'll have to wait for a foolproof answer to this, and it'll probably be supplied by browser vendors, not us developers.

Glad it's proved useful for someone though.

John.

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.

CSS

CSS

--

Questions

--

Followers

Top Experts

Cascading Style Sheets (CSS) is a language used for describing the look and formatting of a document written in a markup language. Usually used to change web pages and user interfaces written in HTML, it can also be applied to any kind of XML document. CSS is designed primarily to distinguish the content of a document from its presentation.