html, body {
background-image: url("http://getwallpapers.com/wallpaper/full/e/9/4/629789.jpg");
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
这是我到目前为止的代码。
在lg md中使用浏览器时,背景图片会覆盖整个浏览器,但是在将尺寸调整为sm或xs时,图片会被切断,并且页面底部附近有白色背景。
答案 0 :(得分:1)
我希望这会有所帮助。
class BookList extends Component {
componentDidMount() {
this.props.getBooks();
}
applySorting(books) {
const sortBy = this.props.filter.sortBy;
if (!sortBy) {
return books;
}
return books.sort((a, b) => a[sortBy] < b[sortBy] ? -1 : 1);
}
render() {
const { books, loading } = this.props.books;
let booksContent;
if (!books || loading) {
booksContent = <Spinner />;
} else {
if (books.length > 0) {
booksContent = this.applySorting(books).map(book => <BookItem book={book} key={book._id} />);
} else {
booksContent = <h4>No books found</h4>;
}
}
...
...