/    Sign up×
Community /Pin to ProfileBookmark

CSS Grids – style grid cells independently for a post feed

Hello,

I would like to style a post feed module (Divi theme) so that the first column is 50% width and the rest of the 7 are 25%, creating a grid like this https://www.screencast.com/t/GNJODhIG3

I have this CSS grid code so far, but I can’t find a way of editing it to get the desired layout.

.ds-grid-blog .et_pb_ajax_pagination_container {
display: grid;
grid-template-columns: repeat(5, 18%);
grid-column-gap: 2.5%;}

Is there some code I could add like “column-one, row-one: 50%;”

Any help would be much apreciated,,, thanks.

to post a comment
CSSFull-stack Developer

1 Comments(s)

Copy linkTweet thisAlerts:
@JMRKERApr 20.2019 — Possible alternative CSS setup.
<i>
</i>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;!-- Modified from: https://www.w3schools.com/CSS/tryit.asp?filename=trycss_grid_grid-column_line
and: https://www.w3schools.com/CSS/css_grid_item.asp
--&gt;

&lt;style&gt;
.grid-container {
display: grid;
grid-template-columns: auto auto auto auto;
grid-gap: 4px;
background-color: #2196F3;
padding: 8px;
}
.grid-container &gt; div {
background-color: rgba(255, 255, 255, 0.8);
text-align: center;
padding: 8px 0;
font-size: 30px;
}
.item1 { grid-column: 1 / 3; }
&lt;/style&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;The grid-column Property&lt;/h1&gt;
&lt;div class="grid-container"&gt;
&lt;div class="item1"&gt;1&lt;/div&gt;
&lt;div class="item2"&gt;2&lt;/div&gt;
&lt;div class="item3"&gt;3&lt;/div&gt; <br/>
&lt;div class="item4"&gt;4&lt;/div&gt;
&lt;div class="item5"&gt;5&lt;/div&gt;
&lt;div class="item6"&gt;6&lt;/div&gt;
&lt;div class="item7"&gt;7&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
×

Success!

Help @GekkoPanda spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.26,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...