Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html antd按钮换行文本_Html_Css_Antd - Fatal编程技术网

Html antd按钮换行文本

Html antd按钮换行文本,html,css,antd,Html,Css,Antd,使用包v3,我希望有一个固定宽度的按钮,在需要时环绕其文本和换行符,以便文本适合按钮内部,并在文本周围正确显示边框 以下是我目前尝试的内容:。我注意到使用空白:normal可以与antd一起使用,但不能与antd一起使用 const { Button } = antd; ReactDOM.render( <> <div style={{width:"100px"}}> <Button block type="pri

使用包v3,我希望有一个固定宽度的按钮,在需要时环绕其文本和换行符,以便文本适合按钮内部,并在文本周围正确显示边框

以下是我目前尝试的内容:。我注意到使用空白:normal可以与antd一起使用,但不能与antd一起使用

const {  Button  } = antd;

ReactDOM.render(
  <>
  <div style={{width:"100px"}}>
    <Button block type="primary" ghost style={{whiteSpace: "normal"}}>Wrap around text</Button>
  </div>
  <button style={{width: '100px', whiteSpace: 'normal'}} type='primary'>Wrap around text</button>
  </>,
  mountNode,
);
ant btn类具有固定高度属性,您应该需要自动覆盖它,它才能工作

<Button block type="primary" ghost style={{whiteSpace: "normal",height:'auto',marginBottom:'10px'}}>Wrap around text</Button>
ant btn类具有固定高度属性,您应该需要自动覆盖它,它才能工作

<Button block type="primary" ghost style={{whiteSpace: "normal",height:'auto',marginBottom:'10px'}}>Wrap around text</Button>

妈的,解决办法总是很简单,但我永远也弄不明白!谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢谢!谢谢沙希德