Contact Form 7 - How Do I Style The Select Arrow and Select Options - wordpress

I'm building a website using Contact Form 7 for WordPress and am having issues styling the select menu. Specifically, I cannot move the arrows or add padding to the dropdown so it's not so tight.
I've tried using this CSS to add spacing to the dropdown items (and some other CSS trickery) but it has no effect:
options {
padding: 20px 10px!important;
margin: 20px 10px!important;
line-height: 36px!important;
border-bottom: 10px solid tan!important;
}
Do you know if there's a way to control the styling behavior of CF7's select menu (arrow and options dropdown)?
Thank you!
Demo Website:
https://miles.birdhouse-demos.com/connect/

CSS styling for <select/> fields is very limited and does not allow you to achieve this. You will need to use a hybrid field plugin that constructs dropdowns with HTML lists that can be styled, such the Hybrid HTML Dropdown plugin, which can be styled and can be loaded on your page to convert your existing <select/> fields into hybrid ones,
<script type="text/javascript">
(function(){
let sel, hyd;
document.addEventListener('DOMContentLoaded', (e) => { //instantiate on document ready.
sel= document.querySelector('#my-select-list');
hyd = new HybridDropdown(sel,{});
})
})
</script>
Alternatively, you can install the Smart Grid-layout extension for CF7 which has a dynamic-dropdown field tag you can use instead of the CF7's default dropdown, and has as the option to display as a Hybrid Dropdown field for you.

Try this
It's possible to customize the dropdown arrow with this code:
select {
-webkit-appearance: none;
-moz-appearance: none;
background: url(http://cdn1.iconfinder.com/data/icons/cc_mono_icon_set/blacks/16x16/br_down.png);
background-repeat: no-repeat;
background-position-x: 98%;
background-position-y: 2px;
}
Here is a list about what you can do with this code:
Remove completely the arrow, to do so, simply remove this line: "background: url(http://cdn1.iconfinder.com/data/icons/cc_mono_icon_set/blacks/16x16/br_down.png);"
Customize the arrow size. You need to add the following line to the code given above: background-size: 30px 30px;
You can change the value in px.
Change the arrow, to do so, replace the URL in the following line of code: "background: url(http://cdn1.iconfinder.com/data/icons/cc_mono_icon_set/blacks/16x16/br_down.png);"
This guide will help you to inject the code: https://www.jotform.com/help/117-How-to-Inject-Custom-CSS-Codes
If you have any questions, let me know.
Thanks.
Credit: Kevin - From: https://www.jotform.com/answers/2449062-how-can-i-remove-modify-change-the-dropdown-arrow-using-css

Related

Using Reactjs with Styled Components - Currency Sign £ is displayed as a ? in styled button

I'm using a styled-components to style a botton in a react application. The botton is an add to cart button and I want the text in the button to have the currency sign next to the price.
However when I run the application it displays a ? inside a diamond instead of a £ symbol.
Can someone explain why this is happening and how to fix it?
This is what the browser renders:
This is the styled-component code:
<AddToCartButton
data-item-id={productItem.ProductId}
data-item-price={productItem.Price}
data-item-url={productItem.ProductUrl}
data-item-description={productItem.Description}
data-item-image={productItem.ProductImageUrl}
data-item-name={productItem.ProductName}
{...dynamicProps[i]}>
ADD TO CART £{productItem.Price}
</AddToCartButton>
and this is the definition of the styled-component:
export const AddToCartButton = styled(Button).attrs(() => ({
className: 'snipcart-add-item'
}))`display:block;
color: #fff;
background-color: #009539;
border-color: #009539;
border-radius: 35px;
padding-left:35px;
padding-right:35px;
padding-top:15px;
padding-bottom:15px;
margin-left:auto;
margin-right:auto;
font-weight:900;
font-size:14px`
I'm not sure if this is something to do with CSS in genreal or a specfic problem when using styled-components.
Not sure if it's related to any of them, but can you replace it with £ ? also as a test, try changing your font-family property to make sure it's not related to it.

Hide featured image using CSS, Wordpress, Avada Them, Fusion Builder

This is a wordpress website - https://smecollaborative.org/
Down the page there is a section pulling from the Events Calendar. Each Event has a featured image. You can use CSS to hide the featured image of each image, but the challenge is using the Fusion Builder element, the featured image is replaced with a 'placeholder' image off a calendar, and I can't get that thing hidden.
Here are the two snippets I've tried:
.single-tribe_events .page-header-image-single {
display: none;
}
.tribe-events-event-image img {
display:none!important;
}
.fusion-events-shortcode .tribe-events-event-image {
height: auto !important;
}
The 2 snippets you tried are wrong because:
snippet 1. is targeting the header image on the tribe event single page.
snippet 2. is targeting an img tag which does not exist in this case.
You should target the parent item to also hide the clickable link to it:
.fusion-events-post div.fusion-events-thumbnail {
display: none;
}
I added the extra div to the thumbnail selector to override the standard display: block; without having to use !important
Or, in case you only want to hide it if the image is missing you can do:
.fusion-events-post .fusion-events-thumbnail span {
display: none;
}
This one will only target the placeholder in case it is present

Deactivate the hover effect of products and leave the "quantity" and "buy" buttons always visible

I’m using the Shop Konado theme.
I'm trying to disable the hover effect of the products and leave the "buy" button always visible in the mobile version: https://prnt.sc/t2ul5l (print from my store). Another example: https://prnt.sc/luen4q
I tried to use the following code in the additional Wordpress css:
html .shop-item:hover .shop-item-image:after {
background: none;
}
But it did not work.
This is my store:
https://www.arteverdeagro.com.br/loja/product-category/todos-os-produtos-in-natura/
thanks for the help
This should work.
.box-hover{
opacity: 1 !important;
margin-top:10px !important;
}

Replacing the Close icon for a JQueryUI Dialog box

After extensive searching on this topic, I haven't been able to find an answer, so hopefully someone can help me with this issue. I have a relatively basic dialog box:
$("#dialog-search").dialog({
resizable: false,
height:dimensionData.height,
width: dimensionData.width,
modal: true,
title: dimensionData.title,
position: [x,y],
open: function() {
$("#dialog-search .dateField").blur();
},
close: function(event, ui){
callBack(event,ui);
}
});
What I want to do is replace the X icon (ui-icon-close) with a different icon provided by the ui (ui-icon-minus), so that clicking the minus icon closes the dialog instead. I've seen posts on how to hide the icon or replace it with a custom image in css, but I haven't yet found a way to replace the icon with another icon to perform the same functionality.
Edit: I also want to be able to use ui-icon-close for a different functionality in my dialog box by adding a custom behavior/location, but that may be outside the scope for this question. Feel free to address this if it's a related solution, though.
Try to see the structure of the dialog and it should not be hard to do it.
http://jqueryui.com/demos/dialog/#theming
Use the create event to change the class of the close button icon to class of another icon will do.
http://jsfiddle.net/Quincy/kHU2M/1/
$("#dialog-search").dialog({
create: function(event, ui) {
var widget = $(this).dialog("widget");
$(".ui-dialog-titlebar-close span", widget)
.removeClass("ui-icon-closethick")
.addClass("ui-icon-minusthick");
}
});
Old question, but maybe I'll help someone. Following CSS made the trick for me, totally custom Close button UI. Not very elegant :), but works fine for me.
.ui-icon-closethick {
background-image: url(images/my-10px-image.png) !important;
background-position: left top !important;
margin: 0 !important;
}
.ui-dialog .ui-dialog-titlebar-close, .ui-icon-closethick {
width: 10px !important;
height: 10px !important;
}
.ui-dialog .ui-dialog-titlebar-close {
background: none !important;
border: none !important;
}
.ui-dialog .ui-dialog-titlebar-close, .ui-dialog .ui-dialog-titlebar-close:hover {
padding: 0 !important;
}
My custom close button shown below:

css pie not working on field elements only

I'm using ie8, don't know about other versions.
I'm using pie all over the place and it generally works ok. However, all my form input elements have a box shadow and border radius, and no border (pretty much all the styles for it). In FF/Safari/Chrome all is well, but in IE, the forms lack their box-shadow.
I've also custom-styled my select dropdown fields using this (in coffeescript)
$.fn.extend customStyle: (options) ->
if not $.browser.msie or ($.browser.msie and $.browser.version > 6)
#each ->
currentSelected = $(this).find(":selected")
$(this).after('<span class="customStyleSelectBox"><span class="customStyleSelectBoxInner">' + currentSelected.text() + '</span></span>').css
position: 'absolute'
opacity: 0
fontSize: $(this).next().css("font-size")
selectBoxSpan = $(this).next()
selectBoxWidth = parseInt($(this).width()) - parseInt(selectBoxSpan.css("padding-left")) - parseInt(selectBoxSpan.css("padding-right"))
selectBoxSpanInner = selectBoxSpan.find(":first-child")
selectBoxSpan.css display: "inline-block"
selectBoxSpanInner.css
width: selectBoxWidth
display: "inline-block"
selectBoxHeight = parseInt(selectBoxSpan.height()) + parseInt(selectBoxSpan.css("padding-top")) + parseInt(selectBoxSpan.css("padding-bottom"))
$(this).height(selectBoxHeight).change ->
selectBoxSpanInner.text($(this).find(":selected").text()).parent().addClass "changed"
and calling $('select').customStyle(). Essentially it appends a styled span below the original <select> that will be the new menu style, while still using the original <options>, while hiding the original select via opacity.
These are my sass styles
.customStyleSelectBox
+border-radius(4px)
+box-shadow(0 1px 1px silver inset)
+pie /*adds pie.htc behavior */
position: relative
z-index: 0
width: 70px
background-color: white
color: #333
font-size: 12px
padding: 7px
This was working in IE before (at least the <select> was styled correctly and was actually showing up), but now it's not (now a bunch of field silhouettes that are completely white, melding into each other and into the next input field, not sure what changed. And anyway if it worked the z-index/positioning makes it so that nothing dropdowns when you click it.
Does anyone have a solution for the select dropdowns with custom styles, and the no box shadow problem? Thanks!
apply "position: relative;" to the affected input fields.

Resources