javascript - How to set default Background Color for the custom Elementor widget
I want to set a default background color to custom widget when someone drag the widget to page in Elementor Page Builder.
Answer
Solution:
If you have Elementor Pro you can add "Custom CSS" for widgets: https://elementor.com/help/custom-css-pro/.
You can then set these subset of widgets to display the correct background colour or gradient.
Example:
#widget {
background: linear-gradient(to bottom right, black, grey);
width: 750px;
height: 250px;
}
<div id="widget"></div>
Answer
Solution:
Option 1: Just create a widget, save it as a template and call where you can add elements.
Option 2: add css in appearance->customize->Additional CSS
add class on the widget where you want to add bg color
.your-class{
background: linear-gradient(to bottom right, black, grey) !important;
}
Source