dongyun4010 2015-08-09 00:05
浏览 25
已采纳

时事通讯在中心问题上对齐[重复]

This question already has an answer here:

I have a newsletter that I want to position in the center (HORIZONTALLY) and for it to remain in the center for all devices (assuming I don't want to use media tags). I'm not going to upload the PHP I've used for the newsletter form since it isn't relative. Can anyone see from the code and image attached enter image description herealone what I need to do to get both the title and the newsletter form to always be in the middle? Thanks

HERE ARE THE HTML DIVS AND H1 CLASSES
    <div class="ty-footer-form-block">
        <h1 class=".ty-footer-form-block__title">NEWSLETTER</h1>
        <div class="ty-footer-form-block__form ty-control-group ty-input-append">
        <div>
    </div>

HERE IS THE CSS
    .ty-footer-form-block {
        height: 180px;
        background: #fafafa;
        border-top: 5px solid #fff;
        border-bottom: 5px solid #fff;
        color: white;
    }

    .ty-footer-form-block__form {
        margin: 0 0 10px 0 !important;
        width: 550px;
        top: 80px;
        left: 50%;
        color: #c9c9c9;
    }

    .ty-footer-form-block__title {
        color: #000;
        font-size: 30px;
        font-weight: 500;
        text-align: centre;
        position: relative;
        top:35px;
        left:50%;
    }

    .ty-input-append {
        position: relative;
        margin: 10px 0 0 0;
        width: 100%;
        padding-right: 35px;
    }

    .ty-control-group {
        display: none;
        margin: 0 0 12px 0;
        width: 100%;
        vertical-align: middle;
        .clearfix();
    }
</div>
  • 写回答

1条回答 默认 最新

  • doune1000 2015-08-09 00:14
    关注

    try changing text-align: centre to text-align: center

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?