zoukankan      html  css  js  c++  java
  • css实现文字两端对齐

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style>
          span{
            width: 100px;
            display: inline-block;
            height: 30px;
            line-height: 30px;
            vertical-align: middle;
            text-align: justify;
          }
          span::after{
            content: '';
            display: inline-block;
            width: 100%;
          }
        </style>
    </head>
    <body>
        <div class="demo">
            <p><span>昵称</span><input type="text" style = ' 100px'></p>
            <p><span>电子邮箱</span><input type="email" style = ' 100px;'></p>
        </div>
    </body>
    </html>
    方法一
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style>
          span{
            width: 100px;
            display: inline-block;
            text-align-last: justify; /*不兼容Safari浏览*/
          }
        </style>
    </head>
    <body>
        <div class="demo">
            <p><span>昵称</span><input type="text" style = ' 100px'></p>
            <p><span>电子邮箱</span><input type="email" style = ' 100px;'></p>
        </div>
    </body>
    </html>
    方法二
  • 相关阅读:
    ASP脚本获取服务器全部参数列表说明
    HTML基础教程
    HTML5代码大全
    CSS 属性大全
    Web前端单词大全
    css常用代码大全
    曾国藩:诚敬静谨恒!
    鼠标经过显示菜单
    月入3000+项目
    右侧菜单显示隐藏
  • 原文地址:https://www.cnblogs.com/Rooney10/p/13097663.html
Copyright © 2011-2022 走看看