我需要使用html
和css
创建此类布局。
我使用div
标记为此布局编码。
class App extends Component {
render() {
return (
<div className="AppTitle">
<b>Score:</b>
<div>
<button type="button">Rock</button>
<button type="button">Paper</button>
<button type="button">Scissors</button>
</div>
</div>
);
}
}
App.css
.AppTitle {
margin: 100px;
}
看起来像这样
答案 0 :(得分:2)
使用css进行样式化。给出边界和边界半径。你会得到你想要的东西。
.AppTitle{
padding:50px;
}
button{
padding:20px;
border:1px solid blue;
border-radius:10px;
background-color: Transparent;
}
&#13;
<div class="AppTitle">
<u><b>Score:</b></u>
<div>
<button type="button">
Rock
</button>
<button type="button">Paper</button>
<button type="button">Scissors</button>
</div>
</div>
&#13;
答案 1 :(得分:2)
.mainContainer {
width: 500px;
height: 200px;
border: 2px solid black;
background-color: lightgray;
}
.top {
width: 100%;
height: 100px;
background-color: lightgray;
display: table-cell;
vertical-align: middle;
padding-left: 100%;
}
#score {
margin-top: 50px;
display: inline;
}
.third {
width: 30%;
height: 100px;
background-color: lightgray;
display: inline-block;
}
button {
padding: 20px;
border: 2px solid blue;
border-radius: 10px;
width: 100px;
}
&#13;
<div class="mainContainer">
<div class="top">
<span id="score"><b> Score: </b></span>
</div>
<center>
<div class="third">
<button type="button"> Rock </button>
</div>
<div class="third">
<button type="button"> Paper </button>
</div>
<div class="third">
<button type="button"> Scissors </button>
</div>
</center>
</div>
&#13;