我有一个挑战添加
CSS gutters
到语义UI网格。我有一个网格列,其中有一段正在重复渲染。
这是我的代码:
import React from 'react';
import ReactDOM from 'react-dom';
import { Segment, Grid, Image as ImageComponent, Item, Button } from 'semantic-ui-react'
export default class TeachersListSegment extends React.Component {
render() {
return (
<div>
<Grid.Column mobile={16} tablet={8} computer={8} largeScreen={8} widescreen={8}>
<Segment stacked padded color='blue'>
<Grid>
<Grid.Row>
<Grid.Column width={11}>
<Item.Group link>
<Item>
<Item.Image size='tiny' src='https://semantic-ui.com/images/avatar/large/steve.jpg' />
<Item.Content>
<Item.Header><a>{this.props.header}</a></Item.Header>
<Item.Description>{this.props.description}</Item.Description>
<Item.Description>Another Description</Item.Description>
</Item.Content>
</Item>
</Item.Group>
</Grid.Column>
<Grid.Column width={5}>
<Button positive className="mb-3 teachers-list-button">Book Lesson</Button>
<Button basic color="green" className="teachers-list-button">Send Message</Button>
</Grid.Column>
</Grid.Row>
</Grid>
</Segment>
</Grid.Column>
</div>
);
}
}
下面是呈现片段的代码
<div className="page-content">
<Grid stackable centered columns={2}>
<Grid.Row>
<TeachersListSegment header="Stevie Feliciano" description="Some Description" />
<TeachersListSegment header="Stevie Feliciano" description="Some Description" />
<TeachersListSegment header="Stevie Feliciano" description="Some Description" />
<TeachersListSegment header="Stevie Feliciano" description="Some Description" />
<TeachersListSegment header="Stevie Feliciano" description="Some Description" />
</Grid.Row>
</Grid>
</div>
当前显示如下所示。向显示中添加列间距和行间距的有效方法是什么?我在上面的链接中应用了檐沟样式,但不起作用。
This question
还帮助我应用了正确的代码,使其具有移动响应能力。
对于应用列间距和行间距的解决方案,有什么建议吗?