如何使用property在另一个div中垂直对齐div vertical-align:middle
。
这是我的代码。
.hello {
height: 100px;
width: 100px;
background-color: black;
vertical-align: middle;
display: inline-block;
color: white;
}
.parent {
height: 400px;
width: 400px;
border: 1px solid red;
display: table-cell;
}
Run Code Online (Sandbox Code Playgroud)
<div class ="parent ">
<div class="hello">
hello
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我参考并发现给父表单元属性和子级内联块工作,但仍然没有。
HTML
目前我正在研究一个以太坊dapp(投票),在我的智能合约中,我有一个函数来获取类型bytes32 []的候选列表,在java脚本方面我没有得到值而不是0x仅如何解析值,下面是代码
pragma solidity ^0.4.0;
contract Voting {
mapping (bytes32 => uint8) public votesReceived;
bytes32[] public candidateList;
string myString = "someString";
function Voting(bytes32[] candidateNames) public {
candidateList = candidateNames ;
}
function totalVotesFor(bytes32 candidate) view public returns (uint8) {
return votesReceived[candidate];
}
function addCandidate(bytes32 candidate) public returns (bool){
require(isNewEntry(candidate));
candidateList.push(candidate);
return isNewEntry(candidate);
}
function voteForCandidate(bytes32 candidate) public {
require(validCandidate(candidate));
votesReceived[candidate] += 1;
}
function getCandidateList() view public returns (bytes32[]) {
return candidateList;
}
function isNewEntry(bytes32 candidate) view public returns (bool) …
Run Code Online (Sandbox Code Playgroud)