To center the main container, add:
body.page-id-16 .hentry-wrapper {
margin-left: auto;
margin-right: auto;
}
However, this looks like it pushes the content to the right. This is because the parent element is a lot wider than the viewport. Thus we should limit this element to the viewport width to actually center the content. We can add this:
body.page-id-16 .hentry {
width: 100%;
}
The body.page-id-16
prefixes to the CSS selectors are to limit these CSS declarations to this exact page. This reduces any styling regressions to other pages that could otherwise be caused by these declarations being applied more globally.
Related Posts:
- Customize Bootstrap checkboxes
- What is WebKit and how is it related to CSS?
- How can I vertically center a “div” element for all browsers using CSS?
- Is there a color code for transparent in HTML?
- How can I center an absolutely positioned element in a div?
- How to override the properties of a CSS class using another CSS class
- CSS display: inline vs inline-block
- Aligning two divs side-by-side
- CSS transition shorthand with multiple properties?
- How to center HTML5 Videos?
- Text border using css (border around text)
- Is there an opposite CSS pseudo-class to :hover?
- U8Qtu
- Using custom fonts using CSS?
- How can I transition height: 0; to height: auto; using CSS?
- Display Images Inline via CSS
- Why CSS3 Animation is not working?
- Why is my Bootstrap code not working?
- Using margin / padding to space span tag from the rest of the p tag
- How to make canvas responsive
- How to change version of .css in WordPress?
- Disable SSL / HTTPS for wordpress
- Forcing reload of editor-style.css
- How can I make the wordpress editor apply the selected template?
- How do I remove specific styles from the parent theme css using the child theme css?
- Why isn’t my theme processing SASS?
- What CSS rules are introduced to core blocks through wp-block-styles?
- How to combine multiple CSS files and concatenate JavaScripts if WordPress recommends enqueuing them?
- Trying to load a responsive CSS media query using Custom Taxonmy
- Deregister CSS style link ‘open-sans-css’
- How to load different css file depending on language
- Can the Theme Customizer be used to generate static/cachable CSS, and how?
- Woocommerce include custom stylesheet after woocommerce styling [closed]
- I want to change my post titles from h2 to H1
- Change logo on specific page id using css
- Write text below a specific part of a sentence
- Style classic editor buttons
- Layer post title on top of image WordPress featured thumbnail image
- Twig + wordpress – how to get filemtime for style.css
- Inconsistent `body_class()` function
- Is there a way to change the backround color of the native video player in wordpress?
- How to Add Custom CSS to the Media Thickbox?
- Link theme options page using ACF to styles
- footer disappear on some pages frequently
- jQuery UI styles conflicting with TinyMCE dialog
- How to change H1 color only for pages [closed]
- Background image reversed on pages after home page [closed]
- How to get an unique identifier for a page/post/category/tag etc.?
- Display Something in the Header After All Styles are Loaded
- wordpress – site not update after update style.css
- Remove CSS Attribute by Overriding CSS in Child Theme
- CSS gap issue in div element
- WordPress custom CSS file overrided by internal CSS [closed]
- Can you change the color of svg icons to the global color I choose from WordPress
- After moving my site, sub-menus are not showing [closed]
- Theme twentythirteen widget area clearfix
- WordPress hide the username/password fields in login page
- Disable CSS for IE 8 and earlier.
- Using categories on navigation bar instead of pages
- Superfish and WordPress: Active Color Problem
- I have a wordpress website which uses a really weird font on Opera. What do I need to do to fix it?
- Elementor – Edit Global Colors Order
- the_post layout
- How To Remove All Other Plugins CSS
- Modal dialog under the backdrop
- Hot reload failing to update file changes
- How can I hide this custom slider while Elementor editing window is open?
- Change post featured image
- How to remove the specific class
- Customizer Appearance Issue
- Change mobile menu color from red to another color
- Removing a CSS rule from Custom Taxonomy
- Change the version of default style.css in wordpress
- style.css not working but customizer additional css does?
- Performance hit of Inline CSS
- Remove top bar header
- How to set different color in a select box due to selection with css
- How to disable all css from the theme for a specific post type page
- Change WP Child theme CSS for WP Bootstrap Starter Theme
- Fonts are parsed in one way but rendered in a different way
- Divi Theme HTML code is different in View Page Source than in the Firefox Inspector
- Add WordPress Core CSS into editor-style.css
- Change Login CSS – Include instead of echo
- How to implement a JavaScript and CSS file for my WordPress homepage?
- Creating a custom header
- Custom font isn’t active on all PCs
- Responsive table on ios safari
- How do I hide a specific div class inside ? [closed]
- Issue with TABLE or DIV padding on Mobile [closed]
- Using browser detection and the body_class() function to modify css
- css targeting submenu current-menu-item list item [closed]
- Overide a CSS already loaded
- IE 6~8 ignoring font, background, and margins on sidebar [closed]
- Best practice for custom primary color of pages
- Custom theme – Bootstrap CSS not loading via wp_enqueue_style or otherwise
- Layout totally broken
- Block content rendered with inline CSS. How do I reuse it in a headless setup?
- Style.css and .js files doesn’t load at first – load only after forced reload
- Sass @use and the style.css file header
- How do I remove/hide embed excerpts from posts