【发布时间】:2017-06-06 22:48:18
【问题描述】:
我想将 2 个<div>s 并排放置。我怎样才能做到这一点?
两者都应该是 50% 的宽度。有人可以帮助纠正我的代码吗?
这是代码:
<hr class="hr--small">
<div class="grid">
<div class="grid__item text-left">
<p class="site-footer__links">{{ 'layout.footer.copyright' | t }} ©
{{ 'now' | date: "%Y" }} {{ shop.name | link_to: '/' }} • All Rights Reserved
</p>
</div>
<div class="grid__item text-right">
<p class="site-footer__links">
<a href="http://www.w3schools.com/html/">Privacy Policy</a> •
<a href="http://www.w3schools.com/html/">Terms & Conditions</a>
</p>
</div>
目前它们左右显示正确,但带有换行符。只是希望它们出现在同一行。
【问题讨论】:
-
你尝试过任何 CSS 吗?
-
我开始输入
2 divs,Google 自动将其完成为2 divs next to each other。多么美妙 -
附带说明,如果您是初学者,我建议您不要将 Shopify 布局作为您的第一个项目进行编辑。让专业人士为您提供帮助。