[英]How do I manuever this element on my website
The current code I have is 我目前的代码是
<div class ="main">
<div id="post" class="post">
<div class = "upvote_downvote">
<div id = "upvote" class = "upvote">
<div class="upvote_arrow_tip"></div>
</div>
<div class = "score">
<p>1</p>
</div>
<div class = "downvote">
<div class="downvote_arrow_tip"></div>
</div>
</div>
<div class = "content">
<a class = "name_and_date">
<spam class="name">
<img class = "pfp" width = "30" height = "30" src="" alt="pfp">
<h3 class="first_last_name">FIRST NAME LAST NAME</h3>
<p class = "username">@USERNAME</p>
</spam>
<i class="date_time">DATE      TIME</i>
</a>
<p class = "contents">POST CONTENTS</p>
</div>
</div>
</div>
It is coming out like this: 它是这样出来的:
What I want to happen is the upvote_downvote
div to be to the left of the content
div. 我想要发生的是
upvote_downvote
div在content
div的左边。 However, when I applied float: left
to both divs, the following occured: 但是,当我将
float: left
应用于两个div时,发生以下情况:
The name_and_date
container is a flex box, does this cause issues? name_and_date
容器是一个弹性框,这会导致问题吗? And, the border is being applied to the post
div. 而且,边界正在应用于
post
div。
也许使用display: inline-block
作为容器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.