I try to put my text in the middle of my div but I don't found a nice solution and clean.
With padding the div growth, and it's not what I desire.
I can create a div box, but it's little tricky and when the code grows in complexity that's can add problem.
So if there is a simple solution, I want know it, like TextAlign : "center"
but for the vertical, not only for the horizontal.
import "./styles.css";
export default function App() {
const style = {
border: "1px solid black",
// padding: "50px 0 0 0", // padding is not good
// textAlign : "center"; // but for the vertical that's possible ?
width: "100px",
height: "100px"
};
return (
<div className="App">
<div style={style}>milieu</div>
</div>
);
}
my try on code sandbox: https://codesandbox.io/s/brave-ellis-d9ju09?file=/src/App.js:0-366
result expected: