As far as you are using home-page.php template only for main page, you can add class directly to container div and apply css rules to it:
<div id="container" class="on-main-page">...</div>
css:
#container.on-main-page {
float: none;
width: 100%;
}
Related Posts:
- How to change btn color in Bootstrap
- Failed to decode downloaded font, OTS parsing error: invalid version tag + rails 4
- force footer on bottom on pages with little content
- Dynamically change color to lighter or darker by percentage CSS
- How do I right align div elements?
- CSS “margin: 0 auto” not centering
- CSS text-align not working
- What is the difference between “screen” and “only screen” in media queries?
- How to have an anim gif on a link and play it on hover and reset
- How can I make Bootstrap columns all the same height?
- Align text to the bottom of a div
- Detect if a browser in a mobile device (iOS/Android phone/tablet) is used
- Using font awesome in codepen
- using media queries with LESS
- How can I apply styles to multiple classes at once?
- How to get multiple images to auto resize and stay centered within a div
- CSS rotation cross browser with jquery.animate()
- How can I center
- into a div?
- Are there Gutenberg container blocks?
- How to specify a class added to my gallery
- How to add a “last” class to the last post in loop.php?
- How do i use fontawesome icons in TinyMce editor?
- Assign title-specific class to list items in menu based on WP pages
- Why won’t child theme’s style.css override plugin’s css
- Load custom css after bootstrap
- Highlighting the current page in a navigation menu which links are generated with a custom loop?
- If I dequeue Gutenberg Stylesheet will that have any effect on WordPress 5.0.1?
- How to center a video [closed]
- Remove WordPress/Gutenberg button styles for ACF blocks
- Relative path instead of absolute for wp_enqueue_script
- Specific css on homepage, different one for other pages
- Media library style not loading correctly when selecting a page featured image?
- Using uncss or similar with WordPress?
- How can i add note, caution, warning quote inside the text? [closed]
- Add to Cart button woocommerce background and with doesn’t display correctly
- How to enqueue a random css style?
- Output terms to post_class()
- How To Add a Transition style to WordPress Comment Box? [closed]
- What’s the best way to add the LESS preprocessor to a WordPress theme?
- How to use Japanese characters for a single page
- Certain aspects of site suddenly not working in Chrome and Firefox
- How do I make header.php use different css for different pages?
- How to change header dimensions in WordPress?
- How to display custom style based on theme option select box
- How to disable the hover effect in WordPress and Elementor?
- What makes WP so SEO friendly?
- Implementing a simple slider in code?
- CSS – Initial HTML Margin Issue On WordPress Site
- Target h1 on single post page [closed]
- Can not find css directory in header
- custom header navigation has odd spacing [closed]
- Error in node.js webpack-cli failed to load config, typeError: ManifestPlugin is not a constructor
- dynamic css file for admin / backend and get_option results in Uncaught Error: Call to undefined function get_option()
- Append style tag in head while shortcode runs
- Add a unique body class for every admin page (including trash)
- Why would a theme writer put their CSS in one long string? [closed]
- After I change CSS not updating in the browser
- ACF Pro with SlickJS [closed]
- Where are the contents of WP_Head
- customize continue reading
- Target admin page body via CSS class
- Hide Overflow on a Specific WordPress Template
- Google Chrome CSS issues [closed]
- Implement editor’ CSS on the custom themes
- ACF Gut block broke wordpress default style?
- How to make a function to play only on the home page?
- Where to add this code for a Modal box to work? [closed]
- Text editor toolbar z-index conflict with location plugin pop
- Hide a div class on WordPress ID (Based on template) [closed]
- What is the cleanest way to shrink Gutenberg Blocks to container width?
- Gutenberg Editor: display error with a combination of transform and background-attachment:fixed
- How to make video responsive in full height on mobile?
- div:before appearing in front of the block
- all of a sudden my child theme style.css is being ignored? Its been working fine for months?
- Page flickers when new html5 video loads
- Why is css not applied on paginated query?
- Disable CSS specific page
- Customiser colour picker and best practice for updating css
- Altering the design of WooCommerce notifications [closed]
- How can I add this specific link hover effect to a WP site? [closed]
- HTML5/CSS3 Polyfill for wp-login.php
- Bizarre WordPress CSS update problem
- Making a custom CSS per mobile
- Pages in another language
- Display current category without an active link in wp_list_categories
- Using a style sheet for modern browsers and another for older browsers
- How to insert a clickable and fixed background [duplicate]
- WordPress with PageLines theme: how to change the background color of a page? [duplicate]
- Will the following code make my css deal with images in the optimum way?
- Interactive maps in wordpress
- How to add input search field with roudned corners?
- s2member captcha how to make responsive – css or javascript
- Add Custom CSS Class in Child Theme [closed]
- Min height of page [closed]
- How to define a special character to change the style of my inline code?
- Why is the “Additional CSS” section missing in my theme Customizer?
- Is there a way to edit the fonts of headings without a plugin (in the 2022 theme)?
- WordPress site suddenly not showing some DOM elements but mobile is fine
- Editing size of h3 tag in wordpress on a one-off basis
- Content doesn’t fit on large size desktops like 2560×1440