简体   繁体   English

仅使用CSS进行画布外导航

[英]Off-canvas navigation using only CSS

I am trying to set up an off canvas navigation using only CSS. 我正在尝试仅使用CSS设置画布外导航。 Basically I want the navigation to be 20% width and have it behind the main content and then when you click the menu icon, the header and body content will slide 20% off the right hand side of the screen and the navigation will be revealed. 基本上,我希望导航的宽度为20%,并将其放在主要内容的后面,然后单击菜单图标时,标题和正文内容将从屏幕的右侧滑出20%,然后导航就会显示出来。

I've almost got it working based off a similar implementation(although they were doing it with width and not positioning) but I am struggling with the last little part. 我几乎是基于类似的实现(尽管他们是用宽度而不是定位来实现)来工作的,但是我在最后的一小部分中苦苦挣扎。

Here is my pen 这是我的笔

Any ideas? 有任何想法吗?

Thanks! 谢谢!

Just add background: #fff; 只需添加background: #fff; to .content style definition. .content样式定义。 It will do the trick. 它将成功。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM