How to change border color in react js?
June 11, 2022Hi Friends 👋,
Welcome To aGuideHub! ❤️
Today, I am going to show you. how to change border color in react js with code example.
To change border color, put the App.js class border: '1px solid red'
to change border color.
In this article, we will change border color in react js just like you would create in a normal HTML project. Also, we will style it using normal inline CSS.
Let’s look at the following example to understand how it basically works:
APP.js
import React, { useState } from 'react';
const App = () => {
return (
<div>
<button style={{ width: "100px", height: "50px", border: '1px solid red',}} type="submit">Submit</button>
</div>
)
}
export default App
Step to Run Application: Run the application using the following command
from the root directory of the project:
npm start
Output: Now open your browser and go to http://localhost:3000/,
you will see the following output:
Check the output of the above code example.
All the best 👍