我刚刚用来
npx create-react-app my-app
启动一个项目,运行时npm start
我收到此编译错误
Error while loading rule 'jsx-a11y/alt-text': rule.create is not a function
Occurred while linting my-app/src/index.js
Run Code Online (Sandbox Code Playgroud) 我需要 ia div 中写入的所有文本都是垂直的,就像每行一个字符并居中。
我实现的唯一方法是给 div 一个固定的宽度width: 7%;和word-break: break-all;
有什么方法可以使用 CSS 来实现没有固定宽度的效果吗?
.flex-container {
display: flex;
border: 1px solid #000000;
}
.flex-container > div {
width: 400px;
height: 300px;
text-align: center;
line-height: 75px;
font-size: 30px;
}
.flex-container > div:nth-child(odd) {
background-color : #62d962;
}
.flex-container > div:last-child {
display: flex;
justify-content: flex-end;
}
.flex-container > div:last-child div {
width: 7%;
}
.flex-container div:last-child div:nth-child(odd){
background-color: #65e9e3;
word-break: break-all;
line-height: 1em;
padding: 1em 0;
}Run Code Online (Sandbox Code Playgroud)
<div class="flex-container">
<div></div> …Run Code Online (Sandbox Code Playgroud)