我正在使用神奇的 react-icons 包 (http://gorangajic.github.io/react-icons/fa.html),特别是 font awesome 包。
如果这不是 react,那么我会给标签添加一个属性,例如:http://fontawesome.io/examples/
<i class="fa fa-camera-retro fa-5x"></i>
然而,如果我将fa-5x添加到FaFolderOpen标签中,它并没有任何作用。正如您所见,我正在使用react-bootstrap,并将图标放在一个按钮上(应该是块级元素吗)?
我相信这个问题以前已经被问过了,但我没有通过搜索找到它。
这就是它的样子,我想让它更大:
const React = require('react')
import { Form, FormControl, FormGroup, ControlLabel, Col, Button, Tooltip, OverlayTrigger } from 'react-bootstrap'
import FaFolderOpen from 'react-icons/lib/fa/folder-open'
import FaFileCodeO from 'react-icons/lib/fa/file-code-o'
import FaFolderOpen from 'react-icons/lib/fa/folder-open'
import FaFileCodeO from 'react-icons/lib/fa/file-code-o'
<Button type="button" bsStyle="success" block onClick={(e) => folderChooser(e)}>
<FaFolderOpen />
</Button>
<i className="fa fa-camera-retro fa-5x"></i>
,应该可以正常工作,因为class
是一个保留关键字,所以要应用css class
,我们需要使用className
。 - Mayank Shukla