html - 内容未正确填充 CSS 网格列

标签 html css wordpress

我在 wordpress 的静态页面中显示“帖子提要”时遇到了很多麻烦。我制作了一个网格列显示,它根据屏幕大小自动调整列数,但是当它达到特定屏幕大小时,帖子内容不再填充其分配的空间,我不知道如何修复它。

有问题的页面是这样的:https://auroranislands.com/spellbook/air-arcana/

我正在使用这个简单的短代码提取帖子内容:

[display-posts category="Air Arcana" posts_per_page="-1" include_content="true" wrapper="div"]

我用来显示它的 CSS 是这个:

div.display-posts-listing {
	list-style-type: none;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit,minmax(250px,1fr));
	column-gap: 15px;
	column-rule: none;
}

div.listing-item {
	clear: both;
	margin: 9px 0;
	overflow: auto;
	list-style: none;
	background-color: lightgray;
}

div.listing-item a.image {
	display: none;
}

div.listing-item a.title {
	display: none;
}

div.listing-item span.excerpt-dash {
	display: none;
}

div.listing-item span.excerpt {
	display: none;
}

如果有人能提供帮助,我将不胜感激!

最佳答案

我查看了您的源代码,您的表格周围似乎有一个带有名为“内容”的类的 div,该 div 将您的表格宽度限制为 67.5%。如果您删除“内容”类或覆盖宽度属性。您的代码应该可以正常工作。 content class restricting the width of table elements

关于html - 内容未正确填充 CSS 网格列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54329740/

相关文章:

html - 选中选项卡时隐藏内容

php - 在产品销售时将自定义文本标签添加到价格

php - 服务器端应用程序的 Google+ 登录验证无法正常工作

html - 使 Span 标签覆盖按钮的整个宽度

html - 如何对齐不同组件中的两个 div?

javascript - 根据突出显示的文本获取 <a href> 内容

html - 未选择 Jquery 选项不起作用

html - 两个 div 在另一个 div 中的垂直对齐而不使用显示 :flex

.net - 分两行打印菜单项.... CSS

jquery - CSS 背景图片与导航栏