- This topic has 7 replies, 3 voices, and was last updated 7 years, 7 months ago by Tom.
-
AuthorPosts
-
August 9, 2016 at 10:19 am #216914Roland
Hi Tom,
I wanted to vertical align text in a table. It’s about this page: http://einfachgutschreiben.com/lorem-ipsum/
In the bottom of the post edit screen I found the metabox Simple CSS. I wrote this code in the box:
td, th { vertical-align: top; }
That doesn’t work at all.
I cut the code und copied it in the Simple CSS editor (Appearance, Simple CSS). That works fine.
Now I’m wondering what is the metabox on the pages / posts edit screens good for? What is the difference between writing code in the metabox and writing code in the editor?
Kind regards
RolandAugust 9, 2016 at 12:00 pm #216945LeoStaffCustomer SupportHi Roland,
I am pretty sure they should both work. The codes in the metabox on the pages/posts would only effect that specific page/post. The codes in the editor would effect all pages in your site (in your case all the tables on the site). I’m not quite sure why it didn’t work for you though…did you have other CSS in the metabox that might be breaking it?
Tom please correct me if I’m wrong π
August 9, 2016 at 8:13 pm #217053TomLead DeveloperLead DeveloperExactly π
August 10, 2016 at 12:12 pm #217214RolandHi Leo, hi Tom,
thank you! π
It was my fault, I think I wrote the code in the post http://einfachgutschreiben.com/lorem-ipsum/, but I controlled the changes on the blog’s page http://einfachgutschreiben.com/tipps/. Sorry!
It works fine, but now another “problem” occured. There is one page where the code, written in the metabox of the page, still doesn’t work – it’s the blog’s page http://einfachgutschreiben.com/tipps/. Precisely:
Post: http://einfachgutschreiben.com/lorem-ipsum/
It works.Page: http://einfachgutschreiben.com/coaching/
It works.Blog’s Page: http://einfachgutschreiben.com/tipps/
It doesn’t work.Maybe the metabox’s behaviour is different on the blog’s page?
August 10, 2016 at 2:55 pm #217253LeoStaffCustomer SupportIt should behave the same on blog page. I just tested out using inspect element and the same code worked for me.
Are there other CSS in the blog metabox that might be breaking the code?
On that note, if you want every table to style like that, you can try entering the code in the actual editor? That way you don’t have to enter the same code on every single page πAugust 10, 2016 at 3:59 pm #217270TomLead DeveloperLead DeveloperThe blog page (any page set as the posts page) will ignore all metaboxes – it’s just the way WordPress works I’m afraid.
If you’re going to be targeting CSS for the blog only, it needs to be added into the global CSS (Appearance > Simple CSS) with the .blog selector:
.blog .my-selector, .archive .my-selector { /* CSS in here will show up on your main posts page and archives */ }
August 10, 2016 at 4:10 pm #217279LeoStaffCustomer SupportThanks for the correction π Just making sure, the CSS entered in the global editor would also work on blog page without the .blog selector? (if we are not targeting blog only)
August 10, 2016 at 4:11 pm #217281TomLead DeveloperLead DeveloperThat’s correct π
-
AuthorPosts
- You must be logged in to reply to this topic.