1.首先固定宽高 (将文字移至左边,例如 “姓名:”)

  .line{

        width:100%;

        height:40px;

        float:left;

        border-bottom:1px solid #ccc

    }

    .title{

        height:38px;

        width:50px;

        line-height:38px;

        float:left;

        text-align:right

    }

2.写个js语句控制默认文字的位置(例如:“请输入您的姓名”):

<!-- 控制行宽 -->

    <script>

            var inputWidth = document.body.scrollWidth - 100;

            $(".inputStyle").css("width", inputWidth + "px");

    </script>

 

底部线条css样式

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-12-10
  • 2021-10-17
  • 2021-12-10
  • 2022-12-23
  • 2021-12-04
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-08
  • 2021-09-30
  • 2022-12-23
  • 2022-12-23
  • 2021-11-26
相关资源
相似解决方案