How to move this span to the left in dropdown button?

Viewed 69

I have a dropdown button that contains a span which is kind of label. The point is that I use specific width which is needed, but Whatever I tried span is not moving to the left. it still stays in the center.


<dropdown-button class="dropdown-button">
    <span class="dropdown-label">Select it</span>
<dropdown-button>
.dropdown-button {
      min-width: 160px;
      font-size: 14px;}

.dropdown-label {
        text-align: left;}
      

How can I move that dropdown-label which is a span element to the left of the button?

1 Answers

Text-align needs to be set in the button element, not the span child element.

button {
      min-width: 160px;
      font-size: 14px;
      text-align: left;}
<button>
  <span>Select it</span>
</button>

Related