Archived topic
Site Library Template Dispatch - Sidebar Widgets
3 replies · Started by Butch Pornebo on March 5, 2021
Site Library Template Dispatch - Sidebar Widgets
https://gpsites.co/dispatch/hook-elements/
The post title on the Sidebar Widget,
What is the CSS code to place the title on the top half of the image instead of the bottom half?
Hi Butch,
Go to customizer > additional CSS, find this css:
.wpsp-card .wpsp-content-wrap {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 5% 8%;
-webkit-box-sizing: border-box;
box-sizing: border-box;
background-color: rgba(0, 0, 0, 0.35);
background: -webkit-gradient(linear, left bottom, left top, color-stop(30%, rgba(80, 50, 50, 0.5)), to(rgba(0, 0, 0, 0)));
background: linear-gradient(0deg, rgba(80, 50, 50, 0.5) 30%, rgba(0, 0, 0, 0) 100%);
pointer-events: none;
}
Replace it with this:
.wpsp-card .wpsp-content-wrap {
position: absolute;
top: 0;
left: 0;
right: 0;
padding: 5% 8%;
-webkit-box-sizing: border-box;
box-sizing: border-box;
background-color: rgba(0, 0, 0, 0.35);
background: -webkit-gradient(linear, left bottom, left top, color-stop(30%, rgba(80, 50, 50, 0.5)), to(rgba(0, 0, 0, 0)));
background: linear-gradient(180deg, rgba(80, 50, 50, 0.5) 30%, rgba(0, 0, 0, 0) 100%);
pointer-events: none;
}
so the only difference is top:0 instead of bottom:0. right?
can I just do this instead?
.wpsp-card .wpsp-content-wrap {
top: 0 !important;
}
There are 2 differences.
Overriding your existing CSS is generally not a good practice, especially you know where and how to modify it.
The more CSS you add, the slower your site would be.
1 line of CSS you might not feel it, but if you keep doing this there'll be a lot of unused CSS.