2017-04-18 68 views
0

我使用react-flexbox-grid和我目前的佈局看起來像如何對齊flexbox中的文本?

const SpicyMenu = (props) => (

    <List> 
     {props.foodItems.map(foodItem => <SpicyMenuItem key={foodItem.name} {...foodItem}/>)} 
    </List> 
); 

const SpicyMenuItem = (props) => (
    <Grid fluid> 
     <Row center="lg"> 
      <Col xs={3} sm={3} lg={2}><Avatar src={props.image}/></Col> 
      <Col xs={6} sm={6} lg={4}> 
       <Row around="lg"> 
        <Col>{props.name}</Col> 
       </Row> 

      </Col> 
      <Col xs={3} sm={3} lg={2}> 
       <div>{props.price}</div> 
      </Col> 
     </Row> 
    </Grid> 
); 

export default SpicyMenu; 

當我在瀏覽器中查看這一點,我看到的文字是不是在框中 enter image description here enter image description here

我的代碼是中間對齊在https://github.com/hhimanshu/spicyveggie/tree/menu

我能做些什麼來對齊在Col中央的文字menu分支可用? 謝謝

+0

如果你正在使用'反應,Flexbox的-grid'也許你可以試試['.middle'如文檔中指定的(https://roylee0704.github.io/react- Flexbox的網/)? – aug

+0

這不知怎麼沒有正確對齊項目 – daydreamer

回答