Change blog post text width using CSS
-
AuthorPosts
-
emrold
MemberHi,
I’m trying to make the text of my blog posts a little wider on larger screens (>1200px) by tweaking the CSS. When I tweak the default CSS from 750px to 950px in the browser’s dev tools, it works great:
@media (min-width: 1200px)
.post-wrapper-single .post-wrapper-single-inside {
width: 950px;
}But when I paste the same code in the CSS editor on WP, it doesn’t work at all, it’s as if I changed nothing. The only way I can make it work is by removing the @media (min-width: 1200px) clause, but then that breaks the mobile experience.
Is there another class I need to specify?
Thanks
The blog I need help with is: (visible only to logged in users)
designorbital
Theme AuthorHi,
WordPress Block editor has some its own or core rules which decide the width of editor. You can use this snippet in the Additional CSS section in the Customizer, so they will reflect in the front end of your blog.
I hope it will help you.
ThanksThat’s exactly what I did… I pasted the CSS into the Additional CSS editor and it doesn’t work at all.
Thanks
designorbital
Theme AuthorHi,
Please share your complete css snippet you have pasted in the Additional CSS.
Thanks
Hi!
Thanks for getting back to me. Here’s the code that I’m using in Additional CSS:
media (min-width: 1200px) .post-wrapper-single .post-wrapper-single-inside { width: 1000px; }
I also created a page with screenshots that describes what I’m trying to do and what it looks like. Hopefully this will be helpful!
https://ericdelorme.ca/resize-css/
Thanks again
designorbital
Theme AuthorPlease try the following one,
@media (min-width: 1200px) { .post-wrapper-single .post-wrapper-single-inside { width: 1000px; } }
Thanks
That’s what I was trying… sorry about the typo in my code snippet above (missing “@”).
When I use the @media clause, it’s like the whole CSS snippet is ignored altogether. Very strange.
Thanks
designorbital
Theme AuthorHi,
I am able to use css snippet with @media in Customizer > Additional CSS.
Can you send me the screenshot of Customizer > Additional CSS so i may have an idea.Thanks
Hi,
I documented everything here with screenshots. https://ericdelorme.ca/resize-css/
Thanks for your help
designorbital
Theme AuthorHi,
You are not using css snippet properly. You are missing curly braces of @media block.
Please copy and paste the following code.@media (min-width: 1200px) { .post-wrapper-single .post-wrapper-single-inside { width: 1000px; } }
Hope it will help you.
ThanksIt worked great, thanks!! It’s interesting that the Additional CSS editor is more strict about syntax than the browsers are…
I appreciate your patience and assistance.
- The topic ‘Change blog post text width using CSS’ is closed to new replies.