Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
76
rated 0 times [  83] [ 7]  / answers: 1 / hits: 29630  / 7 Years ago, mon, february 20, 2017, 12:00:00

With ant.design, what is the right way to apply Affix to Header in a Layout so that it stays fixed at the top during scroll? Below is an example layout:



import { Layout } from 'antd';
const { Header, Footer, Sider, Content } = Layout;

ReactDOM.render(
<div>
<Layout>
<Header>Header</Header>
<Layout>
<Sider>Sider</Sider>
<Content>Content</Content>
</Layout>
<Footer>Footer</Footer>
</Layout>
</div>
, mountNode);

More From » reactjs

 Answers
4

The demo in @benjycui's anwser is published at ant.design site now: https://ant.design/components/layout/#components-layout-demo-fixed


[#58857] Saturday, February 18, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
quinn

Total Points: 160
Total Questions: 86
Total Answers: 101

Location: Belarus
Member since Tue, Mar 14, 2023
1 Year ago
;