课程: Advanced Responsive Layouts with CSS Flexbox
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Sidebar position switching
- In the previous chapter I demonstrated how easy it is to use the Flexbox order property to change the order of elements within a Flexbox. I used it to move the sidebar from its default position on the right-hand side to a new position on the left-hand side by simply changing the order property of the sidebar from two to zero. Now I want to attach that behavior to a button on the page so the user can change the sidebar position dynamically within the browser without reloading the content. Now I'm going to tie that behavior to the button up here on the top right-hand corner. In the exercise files for chapter five 05.02, you'll find an emended version of holy-grail.html. If you scroll down a bit you'll see I've added a new piece of content here inside the masthead. it's a div of the class sitdebar-switcher that contains all the buttons that you see in the top right-hand corner. What's important to note here is that each of these links point nowhere. It's just a # in the href attribute…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。