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

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

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度