I have an element in my user interface called SkyElement that is always vertically and horizontally centered in my user interface. I also have an input called PencilInput , which I should always be below SkyElement .
In the user interface, the user has the ability to resize SkyElement (width and height), and I want PencilInput to PencilInput positioned below SkyElement , regardless of size.
PencilInput is currently displayed above SkyElement , regardless of size.
In my render function:
<div className="left-side"> <SkyElement /> <PencilInput /> </div>
HTML PencilInput :
<div className='pencil-input-holder'> <div className='pencil-svg' /> <input className='pencil-input' onChange={this.handleChange} value={this.state.title} /> </div>
In my css:
@mixin absolute-center { display: block; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } .left-side { background: linear-gradient(180deg,
Any help would be greatly appreciated. Thank you
Edit: Added render() SkyElement block
Besides the code below and the .left-side .element above, that all css is for SkyElement
render() { const { connectDragSource, isDragging, hideSourceOnDrag, transformElement, top, left } = this.props; // hide on drag in slot view if (isDragging && hideSourceOnDrag) { return null; } const halfSize = this.props.size / 2; const transform = transformElement ? `translate(-50%, -50%)` : ''; const style = { width: `${this.props.size}px`, height: `${this.props.size}px`, borderRadius: '50%', background: this.radialGradient(), opacity: isDragging ? 0.2 : this.props.opacity, boxShadow: this.boxShadow(), transform, transition: 'background 0.2s', position: 'relative', top, left, }; return connectDragSource( <div onClick={this.editElement} className='element' style={style}> { this.props.labelPosition ? <ElementLabel title={this.props.title} position={this.props.labelPosition } /> : null } </div> ); }