CSS Formatting
-
I added some CSS to one of my pages, saved it and then exited. A few days later I came back and none of the code is there but the CSS is still being applied to the page. I can’t edit any of the original CSS and if I add new CSS it compounds (eg. the original padding was 10px so if I tried to make the padding 5px it would become 15px).
Any idea how I can format all CSS (I have it all backed up on Sublime Text anyway) or access the original CSS?
The CSS revisions page doesn’t help either. Gives me the same problem as above.
The blog I need help with is: (visible only to logged in users)
-
How did you “add the css” to your pages?
The easiest way to add your own css to a WordPress theme is to use a child theme and keep all of your css there. That way it won’t be overwritten when you update the master theme.
Here is a link for more about child themes
https://codex.wordpress.org/Child_Themes -
Hi @agrismartcambodia, you add custom CSS at Customize > CSS and write CSS rules to override the original CSS. At WordPress.com, we do not edit the original CSS, and that is not a good idea with any WordPress installation as when a theme update happens it would override any of your changes.
Can you identify which CSS is the issue? Also, if you happened to put CSS into the content area of a page or post, it will be stripped out typically unless it was done as an inline style declaration within a html tag.
-
@dtlevin, only those on the WordPress.com Business plan can create and use Child Themes, or those that have self-hosted installations of WordPress.
-
@thesacredpath yes that’s how I added the CSS. I added padding to one of my paragraphs and now it is applying it to the rest of the page and there’s no way I can access the CSS.
Is there a way I can just delete everything and start from scratch?
Thank you for your help.
-
@thesacredpath thank you for the info, I am new to WordPress.com but not WordPress.
@agrismartcambodia do you want the padding to only be on the one paragraph and no others?
-
@agrismartcambodia, can you post the CSS that you added, and which page were you wanting to apply it to?
-
You have set a white background color on the body html section, but your pages don’t seem to have any content, only titles, and those are set to a very light color so that they don’t show.
In h1 in your custom CSS, set the color to #000 for now to make it visible since you have your body background color set to #fff (white).
Then let’s go from there. Can you post the CSS that you added that is now gone?
-
Also, I would suggest adding at the very least some placeholder text to your pages so that we can then see the padding and spacing on things.
-
Hello thesacredpath,
I have been adding additional CSS in the customized section of my theme. If I update my theme will the CSS that I added be overwritten or since it was done in that area will it overide the updated theme? Thanks in advance!
-
Hi @katydela, for future, since your site is self-hosted, the best place to post your questions at in the WordPress.org forums.
Additional CSS, entered in the Customizer will not be overwritten by theme upgrades as it is saved in a different place, not added to the original stylesheet.
- The topic ‘CSS Formatting’ is closed to new replies.