html - Preventing two position absolute elements from colliding
问题描述
I have a created a mock of my site here where we have two elements on the screen. A logo and a form.
Both are positioned absolute, but on smaller screens, they end up colliding(or all most). I know there is no way to make a 'margin-top' on elements that have position: absolute
so how could I put space between these two elements (allow scrolling) when viewed on smaller screens?
Here is the codepen link for you to review. I've provided as much information here as I can: https://codepen.io/riza-khan/pen/VwPrXzo?editors=1100
When screen is small, they almost collide (its more severe on the live version).
解决方案
你不应该把它们当作绝对的,它们应该是相对的,然后一旦你再次排列它们,你就可以设置类似padding-bottom: 10px;
图像的东西
推荐阅读
- sharepoint - 具有 4 个条件的 CAML 查询将引发此错误“无法完成此操作。\n\n请重试。”
- python - Web Scraping 问题,使用 BeautifulSoup 库返回空列表
- c# - 如何统一停止触发动画?
- javascript - 带切换的响应式垂直/水平标题表
- javascript - 我究竟做错了什么?从下拉列表中获取选择。Javascript
- javascript - 如何使用jQuery将jsp文件包含在另一个jsp文件中
- discord - 不和谐自我机器人慢
- android-studio - “没有广告配置。” 尝试加载广告时的 onAdFailedToLoad() 方法
- java - 用于 Java 日志记录的净化信息模式
- css - 如何将此引导登录表单移动到视口中心