escobarrro
escobarrro

Reputation: 1

How to center this container

I need to put my article element in the center its a project in react but something doesnt work

its my Signin.js file

<article className="br3 ba b--black-10 mv4 w-100 w-50-m w-25-1 mw6 shadow-5 flex justify-center">
        <main className="pa4 black-80">
          <div className="measure">
            <fieldset id="sign_up" className="ba b--transparent ph0 mh0">
              <legend className="f1 fw6 ph0 mh0">Sign In</legend>
              <div className="mt3">
                <label className="db fw6 1h-copy f6" htmlFor="email-address">Email</label>
                <input 
                  className="pa2 input-reset ba bg-transparent hover-bg-black hover-white w-100"
                  type="email"
                  name="email-address"
                  id="email-address"
                  onChange={this.onEmailChange}
                />
              </div>
              <div className="mv3">
                <label className="db fw6 1h-copy f6" htmlFor="password">Password</label>
                <input 
                  className="b pa2 input-reset ba bg-transparent hover-bg-black hover-white w-100"
                  type="password"
                  name="password"
                  id="password"
                  onChange={this.onPasswordChange}
                />
              </div>
            </fieldset>
            <div className="">
              <input 
                onClick={this.onSubmitSignIn}
                className="b ph3 pv2 input-reset ba b--black bg-transparent grow pointer f6 dib"
                type="submit"
                value="Sign in"
              />
            </div>
            <div className="1h-copy mt3">
              <p onClick={() => onRouteChange('register')} className="f6 link dim black db pointer">Register</p>
            </div>
          </div>
        </main>
      </article>

Its my App.js file

<div className="App">
        <ParticlesBg type="cobweb" bg={true} color="#FFFFFF" />
        <Navigation isSignedIn={isSignedIn} onRouteChange={this.onRouteChange}/>
        { route === 'home'
          ? <div className='row'> 
            <Sidebar  handleClick={this.handleClick} />
            <TextBox text={this.state.text}/> 
          </div>
          : (
             route === 'signin'
             ? <SignIn loadUser={this.loadUser} onRouteChange={this.onRouteChange}/>
             : <Register loadUser={this.loadUser} onRouteChange={this.onRouteChange}/>
            )
        }
      </div>

Thats how this looks

Can someone help make this like wider and put this in center?

I tried the tachyons class like center and flex and justify-center but it didnt work

Upvotes: 0

Views: 31

Answers (1)

Mohammed Malek
Mohammed Malek

Reputation: 175

Updated: Add margin: 0 auto; to your article tag and it will work.enter image description here

Upvotes: 0

Related Questions