收藏
回答

input框一直在最左边?

最开始使用text-indent,但是出现了一个问题

光标始终在最左边

然后用的paddleft:2em;属性

出现了背景图重复问题

真机没问题,开发工具显示重复

最后一次编辑于  2020-03-06
回答关注问题邀请回答
收藏

4 个回答

  • 陈
    2020-03-06

    input的selection-start这个属性试过吗?

    2020-03-06
    有用 1
    回复 1
    • 像风一样自由
      像风一样自由
      2020-03-06
      没有试过,我去试试
      2020-03-06
      回复
  • 是小白啊
    是小白啊
    2020-03-06

    麻烦提供能复现问题的代码片段https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

    2020-03-06
    有用
    回复 3
    • 像风一样自由
      像风一样自由
      2020-03-06
      复现不了,代码片段里是没问题的,项目里有问题,我把所有的文件都清空之后依然有
      除了json文件其他的文件都已经清空了
      2020-03-06
      回复
    • 是小白啊
      是小白啊
      2020-03-06回复像风一样自由
      input即将同层,同层后麻烦再试下
      2020-03-06
      回复
    • 像风一样自由
      像风一样自由
      2020-03-06
      。ok
      2020-03-06
      回复
  • haiger
    haiger
    2020-03-06

    用个view包裹input

    2020-03-06
    有用
    回复 1
    • 像风一样自由
      像风一样自由
      2020-03-06
      已经解决,但是这个问题很早有了还是这样所以发出来问一下
      2020-03-06
      回复
  • TNT
    TNT
    2020-03-06

    工具版本多少

    2020-03-06
    有用
    回复 18
    • 像风一样自由
      像风一样自由
      2020-03-06
      2020-03-06
      回复
    • TNT
      TNT
      2020-03-06回复像风一样自由
      能把search这段代码发出来么 或者搞个代码片段 我试下。有问题反馈给can哥
      2020-03-06
      回复
    • 像风一样自由
      像风一样自由
      2020-03-06
      <!--index.wxml-->
      <view class="container">
        <view class="search">
          <input placeholder="请输入您想搜索的内容" placeholder-class="search_placeholder"></input>
          <text>取消</text>
        </view>
      </view>
      2020-03-06
      回复
    • 像风一样自由
      像风一样自由
      2020-03-06
      .container{padding: 0 0;margin: 0;}
      .search{
        width: 100%;
      }
      .search input{width: 80%;height: 2em;margin: 0 auto; border-radius: 2em;box-sizing: border-box;padding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pHcABBKvQCpoUSCUtPdYBRUG20cR/UZbCbcaWR7HHSTnJ0UgNYy78BN+iBTkNRFWlKQJY6TxBvxGRXzNHHpy75btOwj7iXATgcsCqYC3PeVZp63lyTUjg9f4hHjK1iUQRiH8irUzAoRv55L9NQk3zuUQqzoONt74x8kB4uikMF86D1gcce+Je7SEW7Utj5tifKbgow0SLzVFJDy5sWPCxfK58QbrXpTP1xN2ft1FJNtbHncn2TlxCaQmIqxq+ZbsYTGGF1x1Nt6a605ku8R4bmuM947HV433jpW5Cb+XT0qb5BHL43rzg1w+Y3lCAj2vi40rEAx3G7cqsD0j+N1VYgsLbFUK7x/P/uXpK7bvRz9b2stnQSDpFEwh9UQovEKvgfHGN8rks9D43n9ltoyLVBj/bXWBKFZl7J7dR1bL2O/Ze6aIpBcEkm54YHCOGKga3liOJ4Da7qncU8KtnqU6UXTzgrjgTekGBTjuN2QPQCDABXivs6EBjuPG/kMQCHABXoIbZG+A000J9gCGQEASGG2C7Z/VO5/P94ZAgAuMMME2dOgEgQBXGCrtEhuaQiDAJbhna5JF+jcgEOAa/S0a4M9BIMBF+hhv1L06RuZyuWlRngRG0kGS4Wklm0QshbxsvL21FkR9AhAISDq8HoTfGFaxjzBvCrimVD8e+3oQAJIM2iAAQCAAQCAAQCAAQCAAQCAAQCAAQCAAQCAAQCAAAAgEAAgEAAgEAAgEAAgEAAgEAAgEAAgEAAgEAAgEAACBAACBAACBAACBAACBAACBAACBAACBAACBAAB+4H8CDABrwJpVlyKDcgAAAABJRU5ErkJggg==') no-repeat 0.5em center;background-size: 6.4%;}
      .search-placeholder{color: #CCCCCC;background: none;}
      2020-03-06
      回复
    • TNT
      TNT
      2020-03-06回复像风一样自由
      好像没重复。。焦点也对
      2020-03-06
      回复
    查看更多(13)
登录 后发表内容
问题标签