CSS classes for theme

Does anybody know predefined (suggested by WP) CSS classes which should I use in my theme?

I have seen somewhere in Internet a list of all CSS classes, which are used in WP theme, but can’t find it.

UPDATE: I have found the site where I’ve seen this list: http://www.wpbeginner.com/wp-themes/default-wordpress-generated-css-cheat-sheet-for-beginners/

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

There are many CSS classes generated by WordPress, depending on context.

The Theme Review Guidelines include the following, WordPress-generated CSS classes:

  • Alignment Classes:
    • .aligncenter
    • .alignleft
    • .alignright
  • Caption Related Classes:
    • .wp-caption
    • .wp-caption-text
    • .gallery-caption
  • Post Classes:
    • .sticky
  • Comment Classes:
    • .bypostauthor

Then, there are the body classes generated by body_class().

Then, there are the post classes generated by post_class().

Then, there are the comment classes generated by comment_class().

Then, there are the menu item classes generated by wp_nav_menu().

Method 2

I found this list, which appears to be pretty comprehensive:

http://digwp.com/2010/05/default-wordpress-css-styles-hooks/

(I’m aware that an answer consisting of a link to an external site is discouraged, but not sure what else to do in this case?)

Method 3

Maybe will be useful information from the Codex. Styling List with CSS


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x