Modify the JavaScript property document.body.style.background
.
For example:
function changeBackground(color) { document.body.style.background = color; } window.addEventListener("load",function() { changeBackground('red') });
Note: this does depend a bit on how your page is put together, for example if you’re using a DIV container with a different background colour you will need to modify the background colour of that instead of the document body.
Related Posts:
- Can I change Bootstrap button color?
- Random gradient background color
- CSS Circle with border
- How can I scroll to an element using jQuery?
- Responsive font size in CSS
- Remove CSS class from element with JavaScript (no jQuery) [duplicate]
- Set cookie and get cookie with JavaScript
- Why em instead of px?
- Button Center CSS
- “Uncaught TypeError: Cannot read property ‘style’ of null at.. “
- What is the meaning of == $0 that is shown in inspect element of google chrome for the selected element [duplicate]
- How to change the cursor into a hand when a user hovers over a list item?
- Set timeout for ajax (jQuery)
- How to generate a simple popup using jQuery
- CSS height 100% percent not working
- Bootstrap Dropdown menu is not working
- Bootstrap Dropdown menu is not working
- What do curly braces in JavaScript mean?
- How to make the overflow CSS property work with hidden as value
- How to make a sticky footer in react?
- Can I add background color only for padding?
- Change TD border color with HTML or CSS
- How do you Hover in ReactJS? – onMouseLeave not registered during fast hover over
- How to print HTML content on click of a button, but not the page?
- Changing the width of Bootstrap popover
- Bootstrap 4 Dropdown Menu not working?
- Change text on hover, then return to the previous text
- Textarea Auto height
- Mixed Content Page: requested an insecure stylesheet error
- CSS 3 slide-in from left transition
- Is there a CSS selector for elements containing certain text?
- How to place two divs next to each other?
- “Uncaught TypeError: a.indexOf is not a function” error when opening new foundation project
- how to display a div triggered by onclick event
- Why is jquery show() not working in example
- jQuery scrollTop() method not working
- Set CSS property in JavaScript?
- JavaScript – Count Number of Visitor for Website
- CSS Equivalent of the “if” statement
- Getting or changing CSS class property with Javascript using DOM style
- Fully responsive HTML5 video
- Positioning element at center of screen
- Bootstrap Collapse not Collapsing
- Cannot read property ‘style’ of undefined — Uncaught Type Error
- How to make HTML element resizable using pure Javascript?
- How to add a custom CSS class to core blocks in Gutenberg editor?
- Any alternate TinyMCE4 themes / subthemes?
- How can I reduce the amount of files loaded/included per plugin?
- How to solve ‘Eliminate render-blocking JavaScript and CSS in above-the-fold’ content for multiple files?
- Hide Add to Cart Button
- How do you use JavaScript to detect the homepage
- Collapsible button inside a ul list does work in jsfiddle but not in WP
- Handling URLs in WordPress application
- Combining multiple javascript and css files
- Can “ and “ tags be used in the HTML editor?
- JavaScript added as link/stylesheet
- Eliminate render-blocking JavaScript and CSS in above-the-fold content
- how to add custom css and js on wordpress post editor directly without using .php file
- How to integrate my HTML and javascript into my child theme
- Twenty fifteen theme – change responsive menu condition
- How does wp_enqueue_scripts work?
- Radio buttons live refresh in the customizer
- How to get DEFER or ASYNC attribute to appear when I add a stylesheet with wp_enqueue_style from a plugin? [duplicate]
- Add Codepen animation as Preloader to WordPress
- Cannot set property ‘className’ of null at setThemeFromCookie
- how to prevent all css and javascripts files from loading
- Custom Plugin – CSS works, JS doesn’t
- How can I wrap all blog posts image with
- How to Change CSS Colors from Custom Plugin Settings Page
- Conditionally enqueue a stylesheet based off of a javascript click event
- White screen when attaching css to function.php
- Link to page with posts of specific type
- Show/Hide Div for Login Mask
- prevent HTML output if custom field is empty [closed]
- Is it OK combined wp-include js, jquery, css? [closed]
- WordPress getting css and script files from client machine rather than the server machine
- CSS/JS files in WordPress
- Custom Plugin scripts from admin working in frontend
- Combine CSS Files without plugin
- WordPress Rest Api access the header and extract stylesheets URL
- How to make a function to play only on the home page?
- Overriding inline !important CSS with Javscript code snippet with media query
- Change hover to onclick on menu
- Unable to use Datepicker in a table when inserting a row
- How to properly hide the div of an inline collapsible button?
- jQuery for Fade Preload Causes My Site Favicon to Disappear from Tab of Browser
- Web Developer Console: “Slow network is detected.” with fonts
- Caching of combined CSS and JS fails because of losing MIME types through combining by PHP
- Target a specific container to style on WordPress storefront theme
- How can I make menu items into two seperate buttons with different functions?
- The placeholder text doesnt disappear
- Speed issues because of CSS & JavaScript
- Possible jquery / library conflict in plugin usage
- What can cause JavaScript and CSS files to be minified?
- Element works, but not on wordpress site [duplicate]
- How do I add JS and CSS to WP (Flatsome)
- “Plate” theme broken after update
- This code works, but breaks the media uploader. How do I integrate it in a way that won’t?
- Active Navigation Class Based on URL on icon
- How to remove pop up on website (css changes not visible)?