How to put background-color only a section of a select? CSS

Marius

I have this sample:

link

CODE HTML:

<div class="select-style">
  <select>
    <option value="volvo">Volvo</option>
    <option value="saab">Saab</option>
    <option value="mercedes">Mercedes</option>
    <option value="audi">Audi</option>
  </select>
</div>

CODE CSS:

.select-style {
    padding: 0;
    margin: 0;
    border: 1px solid #ccc;
    width: 120px;
    border-radius: 3px;
    overflow: hidden;
    background-color: #fff;
    background: #fff url("http://www.scottgood.com/jsg/blog.nsf/images/arrowdown.gif") no-repeat 90% 50%;
}

.select-style select {
    padding: 5px 8px;
    width: 130%;
    border: none;
    box-shadow: none;
    background-color: transparent;
    background-image: none;
    -webkit-appearance: none;
       -moz-appearance: none;
            appearance: none;
}

.select-style select:focus {
    outline: none;
}

I put a picture to understand better what I want to do.

enter image description here

How can I do this on my structure?

Does the current structure? Or have another structure created HTML?

Thanks in advance!

Paran0a

Did you want something like this?

http://codepen.io/anon/pen/bVWmgP

.select-style:after {
          content: '';
          background-color: #000;
          position: absolute;
          border-left: 3px solid #F00;
          z-index: 0;
          top: 0;
          right: 0;
          bottom: 0;
          left: 85px;
        }

    .select-style:before {
        content: '';
        background-color: white;
        position: absolute;
        z-index: -20;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
    }

Note: You won't be able to change select lists arrow color without adding an extra image that will represent that arrow.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to add background-color in a section part?

From Java

CSS opacity only to background color, not the text on it?

From Dev

css background color only of text justify

From Dev

Change background color of div on click (CSS only)

From Dev

CSS: How to change background color

From Dev

how to change the background color of a html section depending on the result of an array

From Dev

How to change text color where background of section is white or black

From Dev

Is it possible to change select empty color only with css

From Dev

How to add background color only to scroll the menu?

From Dev

How to change the background color on a input checkbox with css?

From Dev

How to change the background color of a div in HTML/CSS

From Dev

How to set background color with opacity by css?

From Dev

How to fill parent element background color with CSS?

From Dev

How to create transparent background color in html & css

From Dev

How to tile image and put background color in android activity?

From Dev

How to tile image and put background color in android activity?

From Dev

(ag-Grid)How to put the background color to multiple selected rows

From Dev

Change div background color on click using only css

From Dev

simple css apply background-color only on anchor

From Dev

CSS Background-color works bottom half only

From Dev

CSS <select> dropdown not displaying background color in iOS/iPAD browsers

From Dev

How to blur the div below the section with CSS 3 without background image?

From Dev

MaterializeCSS Select Background Color

From Dev

MaterializeCSS Select Background Color

From Dev

how to blur the background image only in css

From Dev

How to blur only background and not content in Ionic/CSS

From Dev

How to clip a background on a colored text (only in css)

From Dev

css img background color

From Dev

Reset Background color CSS

Related Related

  1. 1

    How to add background-color in a section part?

  2. 2

    CSS opacity only to background color, not the text on it?

  3. 3

    css background color only of text justify

  4. 4

    Change background color of div on click (CSS only)

  5. 5

    CSS: How to change background color

  6. 6

    how to change the background color of a html section depending on the result of an array

  7. 7

    How to change text color where background of section is white or black

  8. 8

    Is it possible to change select empty color only with css

  9. 9

    How to add background color only to scroll the menu?

  10. 10

    How to change the background color on a input checkbox with css?

  11. 11

    How to change the background color of a div in HTML/CSS

  12. 12

    How to set background color with opacity by css?

  13. 13

    How to fill parent element background color with CSS?

  14. 14

    How to create transparent background color in html & css

  15. 15

    How to tile image and put background color in android activity?

  16. 16

    How to tile image and put background color in android activity?

  17. 17

    (ag-Grid)How to put the background color to multiple selected rows

  18. 18

    Change div background color on click using only css

  19. 19

    simple css apply background-color only on anchor

  20. 20

    CSS Background-color works bottom half only

  21. 21

    CSS <select> dropdown not displaying background color in iOS/iPAD browsers

  22. 22

    How to blur the div below the section with CSS 3 without background image?

  23. 23

    MaterializeCSS Select Background Color

  24. 24

    MaterializeCSS Select Background Color

  25. 25

    how to blur the background image only in css

  26. 26

    How to blur only background and not content in Ionic/CSS

  27. 27

    How to clip a background on a colored text (only in css)

  28. 28

    css img background color

  29. 29

    Reset Background color CSS

HotTag

Archive