首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >当使用聚合物时,一个div是重叠的另一个div。

当使用聚合物时,一个div是重叠的另一个div。
EN

Stack Overflow用户
提问于 2014-12-25 02:01:21
回答 1查看 489关注 0票数 1

我用聚合物来开发我的网站,当我使用<core-pages>和我的页脚,我的页脚重叠<core-pages>,我想原因是因为<core-pages>有一个绝对的位置,但是如果我把绝对位置取出来,它会破坏页面。有什么建议吗?

这是我的密码

代码语言:javascript
复制
<core-pages flex>
        <section id="settings" class="settings">
            <div class="panel">
                <summary style="margin-left:25px">
                    <h1>Account</h1>
                    <p>Here, you can edit your account information</p>
                        <form is="ajax-form" action="ajax.php" method="post">
                            <paper-input-decorator label="Email" floatingLabel>
                                <input is="core-input" name="email" type="email" required="required">
                            </paper-input-decorator>
                            <paper-input-decorator label="Old Password" floatingLabel>
                                <input is="core-input" name="pass" type="password" required="required">
                            </paper-input-decorator>
                            <paper-input-decorator label="New Password" floatingLabel>
                                <input is="core-input" name="newpass" type="password" required="">
                            </paper-input-decorator>
                            <paper-input-decorator label="Confrim New Password" floatingLabel>
                                <input is="core-input" name="newpass" type="password" required="">
                            </paper-input-decorator>
                            <br />
                            <div align="center">
                                <paper-button id="submitButton" raised=""><core-icon icon="arrow-forward"></core-icon>Update My Account</paper-button>
                            </div>
                        </form>

                </summary>
            </div>
        </section>
        <section>
        asdfsadf
        </section>
    </core-pages>
    <page-footer></page-footer>

这是我的页脚:

代码语言:javascript
复制
<link rel="import" href="../bower_components/polymer/polymer.html">
<polymer-element name="page-footer" noscript>
<template>
    <link rel="stylesheet" href="../css/style.css">
        <footer>
            <div>
                <div class="links">
                    <a href="/"><paper-button raised><core-icon icon="archive"></core-icon>Update Archive</paper-button></a>
                    <a href="/"><paper-button><core-icon icon="face-unlock"></core-icon>Contact and Chat</paper-button></a>
                    <a href="/"><paper-button><core-icon icon="account-balance"></core-icon>Legal Disclaimer</paper-button></a>
                    <a href="/"><paper-button><core-icon icon="receipt"></core-icon>Terms of Service</paper-button></a>
                    <a href="/"><paper-button><core-icon icon="bug-report"></core-icon>Report A Bug</paper-button></a>
                </div>
                <p id="copyright">This website and its contents are copyright &copy;2014-2015 Website Name.</p>
            </div>
        </footer>
</template>
</polymer-element>
/**************FOOTER STYLES**************/
footer {
    position: relative;
    background-color: #fafafa;
    padding: 100px 0;
    padding-left: 64px
}
footer .links {
    margin-bottom: 56px
}
footer paper-button {
    margin-right: 30px;
    margin-bottom:10px;
    opacity: 0.6;
    color: black
}
footer #copyright {
    color: #b3b3b3;
    font-size: 14px;
    text-align:center
}
footer>:first-child {
    max-width: 1032px;
    margin: 0 auto
}

以及<core-pages> css:

代码语言:javascript
复制
:host {
   display: block;
   position: relative;
}
polyfill-next-selector { content: ':host > *'; }
  ::content > * {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  visibility: hidden;
  z-index: -1000;
}

polyfill-next-selector { content: ':host > .core-selected'; }
     ::content > .core-selected {
     visibility: visible;
     z-index: auto;
}

下面是我所说的一些截图,给出一个更好的解释:使用绝对位置:http://prntscr.com/5knveb这里没有:http://prntscr.com/5ko78r

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-12-26 01:08:18

我想出来了,我只需要添加一个相对于polyfill-next-selector { content: ':host > .core-selected'; } ::content > .core-selected {的位置

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27643682

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档