How to use background image inside CSS for wicked_pdf - ruby-on-rails-3

I'm using the wicked_pdf plugin with a rails 3.0 project. I want to define background with image inside css file.
Here is my css code
.thumb-image {
background: url(http://localhost:3000/images/pdf/ideathumbbg.png) no-repeat left top;
width: 1979px;
height: 946px;
position: relative;
padding: 54px;
text-align: center;
margin-bottom: 15px;
}
This does not find the ideathumbbg.png and it does render ideathumbbg.png in the pdf generated.
Is it possible to use the wicked_pdf_image_tag helper inside a css file? or any other best solution for this problem?

Wkhtmltopdf cannot render png or gif images as backgrounds:
http://code.google.com/p/wkhtmltopdf/issues/detail?id=544
Try converting your background image to a jpg.

I solved this by using the SASS asset-data-urlrelative-asset-path, maybe you can use something like this:
background-image: asset-data-url('ideathumbbg.png')

Related

How do I duplicate a Squarespace portfolio entry and retain the background image?

HELP ME please.
On my Squarespace website I would like to duplicate a portfolio entry and retain the design settings of it. In particular, the background image. The portfolio entry “2050/1” has been setup correctly using code. There is an artwork background that runs behind the portfolio gallery and the footer. When I click ‘duplicate’ in the settings for this entry it creates a new portfolio entry but it has a white background, see “2050/1 (copy)”. Is there a way to duplicate the page, and many more pages, without having to individually add code? Please refer to links attached.
https://www.regardsfromyourfuture.com/future-paintings/project-one-44zcm-57lgb-6glfy-p2f7c-nbdk9-76lc2-zh5z9
https://www.regardsfromyourfuture.com/future-paintings/project-one-44zcm-57lgb-6glfy-p2f7c-nbdk9-76lc2-zh5z9-3pcl8
Thanks!
The following CSS, added via Custom CSS / CSS Editor will achieve that.
.collection-60b8480265d7df4bcf8f97ed .page-section:first-child .section-background:after {
content: "";
width: 100%;
height: 100%;
position: absolute;
background-repeat: no-repeat;
background-size: cover;
background-attachment: fixed;
transform: scale(100%);
background-image: url(https://images.squarespace-cdn.com/content/v1/601a2e3ab7c076212fdf7cc4/1627276381665-TKPRGQK0WMFOD4SMWKS0/Paintings_tall+test.jpg?format=2500w);
}
.collection-60b8480265d7df4bcf8f97ed .page-section:last-child .section-background:after {
content: "";
width: 100%;
height: 100%;
position: absolute;
background-repeat: no-repeat;
background-size: cover;
background-position: absolute;
background-attachment: fixed;
transform: scale(100%);
background-image: url(https://images.squarespace-cdn.com/content/v1/601a2e3ab7c076212fdf7cc4/1627276381665-TKPRGQK0WMFOD4SMWKS0/Paintings_tall+test.jpg?format=2500w);
}
Note that the URL that is used is the image URL to the image that you uploaded as the background image to the section in the initial post. Instead, you could upload the image via the "Manage Custom Files" option, and then use the URL to that image instead.

how to reset styles in vue carousel?

I am using vue carousel and I want to change tge color of the pagination dots' borders. I don't know how and if it's even possible. I looked up the style of this buttons in dev tools and tried to rewrite the style. But nothing works
vue-carousel has two properties that control the color of the dots:
paginationColor - (default: #000000) The fill color of the active pagination dot. Any valid CSS color is accepted.
paginationActiveColor - (default: #efefef) The fill color of pagination dots. Any valid CSS color is accepted.
For example:
<carousel paginationColor="gray" paginationActiveColor="red">
demo
Try this in your global CSS
.v-carousel__controls__item{
color: #FFC400 !important;
}
There is a work-around that can give you full control over the dots and their appearance with pure CSS, using pseudo-elements. Make the existing dots transparent, and use ::after to create new dots that you can style as you like.
.VueCarousel-dot {
position: relative;
background-color: transparent !important;
&::after {
content: '';
width: 10px;
height: 10px;
border-radius: 100%;
border: 2px solid black;
background-color: gray;
position: absolute;
top: 10px;
left: 10px;
}
&--active::after {
background-color: red;
}
}
This is not an ideal solution, however the provided options for styling dots in Vue Carousel are quite limited, and if you have a strict style guide to follow, this solution can give you the control you need.

the CSS and all the HTML tags are correct yet my ivu date picker icon is mis aligned. is there a problem with the verson of my VUE js?

I am new to vue js and I am facing an issue with the datepicker icon misaligned. It is going above the input tag.
I am using vue#2.6.8
datepicker icon shout be aligned
You can use below css to fix that alignment issue.
.ivu-date-picker-editor .ivu-input-suffix {
position: absolute;
z-index: 11;
right: 8px;
margin-top: 7px;
}

Override Google's new reCaptcha to make it responsive

I am struggling to find a way to override google's new recaptcha styling. I believe the new version loads its styling from within the api JS file.
Would anyone know how to override this to make it responsive within bootstrap?
<script src="https://www.google.com/recaptcha/api.js?render=onload"></script>
<div class="g-recaptcha" data-sitekey="key"></div>
just make the iframe responsive like this
.g-recaptcha{
position: relative;
padding-bottom: 56.25%;
padding-top: 0px;
height: 0;
overflow: hidden;
}
.g-recaptcha iframe{
position: absolute;
top:0;
left: 0;
width: 100%;
height: 100%;
}
this will make it res
I would add just one more things to Boukraa Mohamed idea:
.g-recaptcha > iframe
This way it will work even if the iframe down-inside of multiple div tags.
Use the below mentioned code
.g-recaptcha {transform: scale(0.85); transform-origin: left top;}
Your question makes not clear which properties you want to override.
The Google's code loads an iframe in the div with class g-recaptcha. The iframe has its own styles sheets. You can manipulate the style sheets in an iframe with javascript or jQuery, see: How to apply CSS to iframe?.
Before using jQuery to manipulate the style sheets you should make sure that the iframe had loaded. See: https://developers.google.com/recaptcha/docs/display#explicit_render it seems that the api does not provide a function to trigger this onload event.

Twitter Bootstrap Extend Background Across Screen

Would like the "light grey" background (on http://CappedIn.com) across the top navigation to stretch across the whole screen. The rest of the content I would like as is. Any ideas how to do this? HAML code include (it shows bootstrap classes I use)
%body
%div.container-fluid
%div.row-fluid.top_nav
%div.span7
= render "/shared/navigation/top_left_nav.html.haml"
%div.span5
= render "/shared/navigation/top_right_nav.html.haml"
= yield
Thanks!
CSS -
.top_nav {
margin-left: -20px;
margin-right: -20px;
width: auto;
background: #EEEEEE;
}