Answers for "react align horizontally"

CSS
0

center horizontally react native

const styles = StyleSheet.create({
  	//Container for View or Text or etc. that must be centered.
    parent:{
        flex:1, // Covers the available space
        justifyContent:"center", // aligns through main axis
        alignItems:"center" // aligns though secondary axis
    }
});
Posted by: Guest on November-23-2021
1

centering items in react css

div.container4 {
    height: 10em;
    position: relative }
div.container4 p {
    margin: 0;
    background: yellow;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-right: -50%;
    transform: translate(-50%, -50%) }
Posted by: Guest on April-19-2021

Code answers related to "react align horizontally"

Browse Popular Code Answers by Language