Currently, I am attempting to position the text within a bold border of its parent element. My component, built using material-ui, resembles this code:
<List className={classes.root}>
<Typography className={classes.fieldLabel}>Attach PDF</Typography>
{/***SOME CODE**/}
</List>
The styles for the two classes (root and fieldLabel) are defined as follows:
root: {
width: "100%",
maxWidth: 360,
border: "3px solid #388FCE",
marginLeft: "3%",
maxHeight: 200,
overflow: "auto",
borderTop: "40px solid #388FCE",
position: "relative",
},
fieldLabel: {
transformOrigin: "0 0 ",
position: "absolute",
fontSize: "1rem",
textTransform: "uppercase",
letterSpacing: "3px",
top: 0,
left: 0,
color: "red",
fontWeight: "bold",
},
I am struggling with getting the "Attach PDF" label to appear inside the border:
https://i.sstatic.net/fD1ZK.png
What could I be doing incorrectly that is causing the label to remain inside the border instead of appearing on it?