Automattic / Automattic/jetpack

Related Posts: Layout breaks when there are more than 3 results

Open
#2,174 5 comments 0 reactions 1 assignee Claimed by @jeffgolenski View on GitHub
[Feature] Related Posts Customer Report [LEGACY] Enhancement
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

When you have more than 3 results in your RPs, the layout is a bit wonky on displays under 640px.
Example:
![screen shot 2015-05-26 at 10 47 10 am](https://cloud.githubusercontent.com/assets/3220162/7819155/b9cdc9da-0394-11e5-8f78-b826c90f4389.png)

I have been suggesting the following as a solution for people who have this issue.

```css
@media only screen and (max-width: 640px) {
div#jp-relatedposts div.jp-relatedposts-items .jp-relatedposts-post:nth-child(3n+4),
div#jp-relatedposts div.jp-relatedposts-items-visual .jp-relatedposts-post:nth-child(3n+4) {
clear: right;
}
div#jp-relatedposts div.jp-relatedposts-items .jp-relatedposts-post:nth-child(3n+6) {
clear: right;
}
div#jp-relatedposts div.jp-relatedposts-items .jp-relatedposts-post:nth-child(3) {
clear: left;
}
}
```
Result:
![screen shot 2015-05-26 at 10 50 40 am](https://cloud.githubusercontent.com/assets/3220162/7819234/1733316e-0395-11e5-829f-2883fe6755b4.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.