【问题标题】:Angular-Material Md-dividerAngular-Material Md-分频器
【发布时间】:2017-07-10 07:26:18
【问题描述】:

是否可以让按钮位于 md-divider 的顶部,如下所示:

【问题讨论】:

    标签: css angularjs angular-material


    【解决方案1】:

    这与Angular无关,你可以通过纯css修复它:

    body{
                    background-color: #E0E0E0;
                    text-align: center;
                }
                h1{
                    font-size: 75px;
                }
                hr{
                    width: 85%;
                }
                .buttons{
                    display:inline-block;
                    position:relative;
                    top:-20px;
                    background-color: green;
                    color: white;
                    padding: 5px;
                    border: 1px solid green;
                    border-radius: 50px;
                    text-align: center;
                }
                .buttons:hover{
                    background-color: #C4C4C4;
                    border: 1.5px solid #171717;
                }
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" />
    
    <h1>Button on top of line</h1>
         <hr>
         <span class="buttons fa fa-plus"></span>

    你可以给你的Md-divider 一个类并使用它来代替我的 hr 示例。但你的想法对吗?

    重点是使用负顶定位。

    【讨论】:

    • 谢谢!!!它适用于 margin-top: abd margin-right 对我来说!它不适用于仅顶部。
    猜你喜欢
    • 2015-06-16
    • 1970-01-01
    • 2016-07-11
    • 1970-01-01
    • 2016-07-11
    • 1970-01-01
    • 2016-06-01
    • 1970-01-01
    • 2016-10-21
    相关资源
    最近更新 更多