How to use scss in an input field

Issue

I have a styling class called section-changing-input which contains a subclass Input. I want the input to have a red border.
However, when I import this class into my <input> element, nothing is displayed.

How do I write the styling class correctly in my div so that I get a red border?

import React from 'react'
import './style/General.scss'


function General() {



    return (
        <div>
                        <div className="field">
                            <p className="control has-icons-left has-icons-right">
                                <input className="section-changing-input" type="text" value="Hello" />
                                <span className="icon is-small is-left">
                                    <i className="fas fa-futbol"></i>
                                </span>
                            </p>
                        </div>


            </div>
        </div>
    )
}

export default General

General.scss

section-changing-input {
    input {
        border-color: crimson !important;
    }
}

Solution

I think you have missed dot for the parent class. Also since the main class is placed for the input tag itself, so there is no child element or class required

.section-changing-input {
  border-color: crimson !important;
}

Answered By – Ponsakthi Anand

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published