DIV next to centered div

后端 未结 6 611
轻奢々
轻奢々 2020-12-16 20:19

\"enter

body {
    background: rgba(0, 0, 0, 0.8);
    font-family: sans-s         


        
6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-16 21:09

    Please, check the repaired JSFiddle of your markup.

    You need to remove #registercontainer and place #register into #login plus some position modifications according to centered block width.

    Result

    HTML:

    Login to The Something Project




    Register for The Something Project

    And CSS:

    body {
        background: rgba(0, 0, 0, 0.8);
        font-family: sans-serif;
        font-size: 11px;
        color: #e0e0e0;
    }
    
    #login {
        margin-left: auto;
        margin-right: auto;
        margin-top: 50px;
        background: rgba(0, 0, 0, 0.9);
        width: 360px;
        padding: 20px;
        position: relative;
        -webkit-border-radius: 15px;
        border-radius: 15px;
    }
    
    #register {
        position: absolute;
        left: 420px;
        top: 20px;
        width: 100px;
    }​
    

提交回复
热议问题