首页 > 解决方案 > React中textarea中滚动条的边框半径问题

问题描述

我想在滚动条和 textarea 的边缘之间放置一些空间,并使用以下代码:

export const Textarea = styled.textarea`
  font-family: Open Sans, sans-serif;
  font-size: 16px;
  line-height: 24px;
  border-radius: 14px;
  width: 600px;
  height: 200px;
  border-width: 0px;
  border: 1px solid #DCDCDC;
  padding: 14px 16px;
  left:-100px;
  resize: none;
  box-sizing: border-box;
  ::-webkit-scrollbar {
    width: 8px;
    height: 60px;
  }
 
  ::-webkit-scrollbar-thumb {
  background-color: #3AA4A4;
  border-radius:2px;
  border-right: 4px white solid;
  background-clip: padding-box;
  }
  ::-webkit-scrollbar-track {
      margin-top: 20px;
      margin-bottom: 20px;
  }
  :focus {
    outline: none;
  }

  :placeholder {
    color: #96a2ac;
  }
`;

但问题是添加了空间,但右上角和右下角的滚动条的边框半径没有添加且可见。

标签: reactjsstyled-components

解决方案


推荐阅读