I’m trying to have several upvote/downvote counters on a row but I’m encountering several problems.
See here.
The arrows and vote should be smaller and get less space but I don’t know yet how to limit it. Instead they enlarge my row. The NAME near them is also not centered. How could I center it? I might change all to a table if that’s the only way.
This is the code:
.sss {
float: left;
clear: left;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<div class="container-fluid bg-primary pl-0 text-white">
<div class="d-flex flex-row">
<div class="p">
<span vote-target="a.id" class="vote ">
<a style="cursor: pointer;" id="upvote" mv="1" class="sss fa fa-sm fa-arrow-up uvote"></a>
<span class="sss" id="count">1</span>
<a style="cursor: pointer;" id="downvote" class="sss fa fa-sm fa-arrow-down dvote"></a>
</span>
<span>NAME </span>
</div>
<div class="p">
<span vote-target="a.id" class="vote ">
<a style="cursor: pointer;" id="upvote" mv="1" class="sss fa fa-sm fa-arrow-up uvote"></a>
<span class="sss" id="count">1</span>
<a style="cursor: pointer;" id="downvote" class="sss fa fa-sm fa-arrow-down dvote"></a>
</span>
<span>NAME </span>
</div>
</div>
2
Answers
You can make the counter containers
d-flex
(flexbox) too, then usealign-items-center
…https://www.bootply.com/FvTTsvIDGX
I removed your too much code but you like result
USING BOOTSTRAP CLASSES
https://www.codeply.com/go/anuRTmVlBl