将定位为帖子标题下方
这是我的第一次网站尝试,我一直在遵循一个很棒的教程,同时尝试以某些方式做我自己的事情。我学到了很多东西,但遇到了一个问题。
该页面位于 http://thelifefilm.com/
侧面的“帖子图块”目前有边距 -顶部来定位它们。这非常有效,直到最后一篇文章延伸到第二行。那么我该如何工作才能使
始终位于帖子标题下方 15px 处。顺便说一句,如果有人能解释一下如何将我的“评论数字”完全集中在小气泡中,因为目前它只对某些数字看起来不错。
如果当我偏离教程时,我的代码在受过训练的眼睛看来很奇怪,请提前致谢并致歉。
This is my first website attempt and I've been following a great tutorial while trying to do my own thing in some ways. I have learnt a lot but have run into an issue.
The page is up at http://thelifefilm.com/
The 'Post Tiles' at the side currently have a margin-top to position them. This works great until the last post that extends onto the second line. So how can I work this so that the <div class="tile">
is always 15px below the post title.
On a side note, if anyone can explain how a go about fully centering my 'comment numbers' within the little speech bubble because currently it only looks good for certain numbers.
Thanks and apologies in advance if when I've deviated from the tutorial my code looks wonky to the trained eye.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
目前
位于
之外。将图块放在文章正文内的
h1
标记下方。移除图块上的上边距。将链接到单个帖子的图块和图片包裹在另一个div
中。将图块向左浮动,将单个帖子图像向右浮动。建议的结构:
让我添加一条编辑内容,出于 SEO 原因,建议每页不要使用多个
标记。我将它们分别设置在
single.php
中的和
中,分别在单个帖子页面上。
Currently the
<div class="tile">
is outside<div class="articleBody">
. Put the tile inside the article body, below theh1
tag. Remove the top margin on the tile. Wrap the tile and the img that links to a single post in anotherdiv
. Float the tile left and the single post image right.Proposed structure:
Let me add as an edit, that for SEO reasons, it is not advisable to have more than one
<h1>
tag per page. I'd make them<h2>
and<h1>
only insingle.php
, respectively on the single post pages.CSS:
HTML:
CSS:
HTML: