Html form submiting with background image
<input type="submit" name="fsubmit" value="Submit" class="Submit" /><br>
.Submit{
background:url(images/Submit-btn.png) left top no-repeat;<br>
border: medium none;<br>
clear: both;<br>
color: #FFFFFF;<br>
cursor: pointer;<br>
float: right;<br>
height: 65px;<br>
padding-bottom: 37px;<br>
width: 83px;<br>
}
Try this:
.icon_button{
background:#FFFFFF url(http://www.limitedlink.com/images/png/ico.png) no-repeat 4px 4px;
padding:4px 4px 4px 22px;
height:auto;
}
Related
Can we change icon from Ionic ion-checkbox ?
Can we use http://ionicons.com/ ?
for now, here my code :
<ion-view>
<ion-content class="has-header">
<ion-list>
<ion-checkbox class="item-checkbox-right">item 1</ion-checkbox>
<ion-checkbox class="item-checkbox-right">item 2</ion-checkbox>
<ion-checkbox class="item-checkbox-right">item 3</ion-checkbox>
Thank you
No, You can't.
As you can see that it is a default icon Set for ion-checkbox. You can only change the css like styling it by change color, background, margin, padding etc.
Alternatively you can change you checkbox to <input type="checkbox> and style it as in ionic.
UPADTED
I have opted pure css solution.
css
input[type="checkbox"] {
display: none;
}
input[type=checkbox]:not(old) + label {
display: inline-block;
padding: 1px;
line-height: 30px;
background:url(https://cdn0.iconfinder.com/data/icons/woocons1/Checkbox%20Empty.png) left top no-repeat;
background-size: 25px 25px;
}
input[type=checkbox]:checked + label { background:url(https://cdn0.iconfinder.com/data/icons/woocons1/Checkbox%20Full.png) left top no-repeat;
background-size: 25px 25px;
}
html
<input type="checkbox" id="1">
<label for="1">Sector 1</label>
Big Thank You #Atula, we cannot change icon from ion-checkbox,
So, with css Ionic icon, here you are my solution (if you have better ? you're welcome) :
Please, help
html
<ion-view>
<ion-content class="has-header">
<div id="frameCheckboxHome" data-ng-click="homeCtrl.toggle('Item1')">
<label>Item1</label><!-- white space
--><div id="checkboxHome"><i class="icon ion-heart {{homeCtrl.homeTab['Item1']}}"></i></div>
</div>
<div id="frameCheckboxHome" data-ng-click="homeCtrl.toggle('Item2')">
<label>Item2</label><!-- white space
--><div id="checkboxHome"><i class="icon ion-heart {{homeCtrl.homeTab['Item2']}}"></i></div>
</div>
</ion-content>
</ion-view>
scss
#frameCheckboxHome{
width: 100%;
border-bottom: lightgrey solid 1px;
padding-top: 10px;
padding-bottom: 10px;
label{
width: 80%;
margin: 0px;
vertical-align: middle;
padding-left: 10px;
}
div{
width: 20%;
margin: 0px;
vertical-align: middle;
display: inline-block;
text-align: center;
}
div i{
color: lightgrey;
font-size: 36px;
}
.selected { color: orange; }
}
js with angular meteor 1.3 Ionic
class Home {
constructor($scope, $reactive) {
'ngInject';
$reactive(this).attach($scope);
this.myTab = [];
}
toggle(param){
!this.myTab[param] ? this.myTab[param] = "selected" : this.myTab[param] = "";
}
}
...
.component(name, {
templateUrl: `imports/ui/components/${name}/${template}.html`,
controllerAs: 'homeCtrl',
controller: Home
})
...
Well, you can change the icon for ion-checkbox with a little tweak ;).
Approach
remove the default icon
add a HTML element whose class changes on the ng-model value of ion-checkbox
Code
HTML:
<ion-checkbox class="custom-checkbox" ng-model="itemChecked">
I'm a checkbox
<i class="icon"
ng-class="{'true':'ion-ios-circle-filled', 'false':'ion-ios-circle-outline'}[!!itemChecked]">
</i>
</ion-checkbox>
CSS:
// positioning custom icon properly
.custom-checkbox .icon {
font-size: 20px;
position: absolute;
left: 16px;
}
// hiding default icon
.custom-checkbox i.checkbox-icon {
display: none;
}
Here's the CodePen Demo for it.
My solution:
.checkbox-md {
.checkbox-icon:before {
display: inline-block;
content: "\f219";
font-family: "Ionicons";
font-size: 1.9em;
color: $primary;
}
.checkbox-icon {
background-color: transparent;
border: none;
height: 32px;
&.checkbox-checked:before {
display: inline-block;
content: "\f147";
font-family: "Ionicons";
font-size: 1.9em;
color: $primary;
}
.checkbox-inner {
border: none;
}
}
}
I have a search box that expands upon hover which relies on the input field being completely hidden initially; however I can't seem to find what is causing this width.
Here is my code; and the live version is: http://stylrs.com/ctf/
.search_header {
float: right;
clear: both;
height: 30px;
}
.search_header input {
-moz-transition: width 0.5s;
-ms-transition: width 0.5s;
-webkit-transition: width 0.5s;
transition: width 0.5s;
width: 0;
margin: 0 !important;
}
.search_header input:focus,
.search_header:hover input {
width: 135px;
}
.fa-input {
background-color: none !important;
color: white;
float: right;
font-family: FontAwesome, 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 15px;
margin-top: 1px;
width: 15px !important;
border: none !important;
padding: 0;
margin: 0;
}
.search_header input[type="text"] {
margin-right: 0;
font-size: 12px;
}
.search_header input[type="submit"] {
appearance: value;
background: none !important;
webkit-appearance: none !important;
}
<div class="search_header">
<form role="search" method="get" id="searchform" class="searchform" action="test">
<div>
<label class="screen-reader-text" for="s"><?php _x( 'Search for:', 'label', 'QEPRize'); ?></label>
<input type="text" value="test" name="s" id="s" />
<input type="submit" class="btn fa-input" value="">
</div>
</form>
</div>
It’s padding and border what causes the input to be visible (even when the width is zero).
Set these properties to zero as well and make them part of your animation.
I've recently been working on some custom checkboxes for a while now and have found it to be a challenge. However, I'm so close to finishing them and had been testing a lot in Chrome which I managed to get them perfect.
I then checked in the other browsers and there were some distinct differences in how my after state was rendered. How do you fix those differences? is it even possible? Or do I just have to use an image?
JSFIDDLE
HTML:
<div class="fb-checkbox">
<br>
<br>
<input id="item21_0_checkbox" name="Project_type[]" type="checkbox" data-hint="" value="Conference" /><label for="item21_0_checkbox" id="item21_0_label" ><span id="item21_0_span" class="fb-fieldlabel">Conference</span></label>
<input id="item21_1_checkbox" name="Project_type[]" type="checkbox" value="Incentive campaign" /><label for="item21_1_checkbox" id="item21_1_label" ><span id="item21_1_span" class="fb-fieldlabel">Incentive campaign</span></label>
<input id="item21_2_checkbox" name="Project_type[]" type="checkbox" value="Incentive travel" /><label for="item21_2_checkbox" id="item21_2_label" ><span id="item21_2_span" class="fb-fieldlabel">Incentive travel</span></label>
<input id="item21_3_checkbox" name="Project_type[]" type="checkbox" value="Awards dinner" /><label for="item21_3_checkbox" id="item21_3_label" ><span id="item21_3_span" class="fb-fieldlabel">Awards dinner</span></label>
<input id="item21_4_checkbox" name="Project_type[]" type="checkbox" value="Product launch" /><label for="item21_4_checkbox" id="item21_4_label" ><span id="item21_4_span" class="fb-fieldlabel">Product launch</span></label>
<input id="item21_5_checkbox" name="Project_type[]" type="checkbox" value="Hospitality" /><label for="item21_5_checkbox" id="item21_5_label" ><span id="item21_5_span" class="fb-fieldlabel">Hospitality</span></label>
<input id="item21_6_checkbox" name="Project_type[]" type="checkbox" value="Comms and marketing" /><label for="item21_6_checkbox" id="item21_6_label" ><span id="item21_6_span" class="fb-fieldlabel">Comms and marketing</span></label>
<input id="item21_7_checkbox" name="Project_type[]" type="checkbox" value="Reward & Recoginition scheme" /><label for="item21_7_checkbox" id="item21_7_label" ><span id="item21_7_span" class="fb-fieldlabel">Reward & Recoginition scheme</span></label>
<input id="item21_8_checkbox" name="Project_type[]" type="checkbox" value="Design brief" /><label for="item21_8_checkbox" id="item21_8_label"><span id="item21_8_span" class="fb-fieldlabel">Design brief</span></label>
</div>
CSS:
input[type="checkbox"] {
display: none!important;
}
/*------ 1st checkboxes ----*/
input[type="checkbox"]:not(:checked) + label span,
input[type="checkbox"]:checked + label span {
position: relative;
cursor: pointer;
}
input[type="checkbox"]:not(:checked) + label span:before,
input[type="checkbox"]:checked + label span:before {
content: '';
position: absolute;
right: 10px;
width: 15px; height: 15px;
border: 1px solid #a5a5b1;
background: none;
border-radius: 3px;
-webkit-box-shadow: inset 0px 0px 8px 0px rgba(50, 50, 50, 0.13);
-moz-box-shadow: inset 0px 0px 8px 0px rgba(50, 50, 50, 0.13);
box-shadow: inset 0px 0px 8px 0px rgba(50, 50, 50, 0.13);
margin: 0;
padding: 0;
}
input[type="checkbox"]:not(:checked) + label span:after,
input[type="checkbox"]:checked + label span:after {
content: '★';
position: absolute;
width: 15px; height: 15px;
top: -1px;
right: 10px;
font-size: 1.2em;
border-radius: 3px;
color: #ffc20e;
transition: all .5s;
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
border: 1px solid #000000;
text-align: center;
vertical-align: middle;
}
input[type="checkbox"]:not(:checked) + label span:after {
opacity: 0;
transform: scale(0);
}
input[type="checkbox"]:checked + label span:after {
opacity: 1;
transform: scale(1);
}
input[type="checkbox"]:disabled:not(:checked) + label span:before,
input[type="checkbox"]:disabled:checked + label span:before {
box-shadow: none;
border-color: #bbb;
background-color: #ddd;
}
input[type="checkbox"]:disabled:checked + label span:after {
color: #999;
}
input[type="checkbox"]:disabled + label span {
color: #aaa;
}
/* accessibility */
input[type="checkbox"]:checked:focus + label span:before,
input[type="checkbox"]:not(:checked):focus + label span:before {
border: 1px dotted blue;
}
If you click the boxes for their checked state and in different browsers you'll notice positioning is off and even the size of the star is slightly different...
EDIT: I know my example doesn't show them perfectly align to start off with - just interested in why they're positioned differently
Try adding a line-height corresponding to the element height for your :after elements used to display the star,
input[type="checkbox"]:not(:checked) + label span:after,
input[type="checkbox"]:checked + label span:after {
/* … */
top: 0; /* modified */
line-height: 13px;
}
With that, it looks OK to me in Firefox and Opera. http://jsfiddle.net/mBWm3/1/
I have a search form with Bootstrap 3 that looks and works perfectly in Chrome and Firefox, but two of the corners are behaving strangely in Internet Explorer and I can't figure out why. I basically have the input button showing as if it was inside the search form, but in reality the search form has no right borders and the input button has no left borders, so it looks like they're one piece.
For some strange reason I can't figure out, in IE it has both rounded corners and some unfinished straight corners on the right side that looks like this:
Here is my HTML code:
<form class="form-inline topsearchform" role="form">
<div class="input-group">
<input class="form-control searchformradius" type="text" placeholder="Search products...">
<span class="input-group-btn">
<button class="btn btn-default searchformbutton" type="button"><i class="icon-search searchicon"></i></button>
</span>
</div>
</form>
And the CSS:
.searchformbutton{
border-radius: 6px;
border: 1px solid #CCCCCC;
border-left:0px solid #CCCCCC;
height:34px;
}
.searchformbutton:active{
border-radius: 6px;
border: 1px solid #CCCCCC;
border-left:0px solid #CCCCCC;
height:34px;
box-shadow:none;
background: #FFFFFF;
}
.searchformbutton:hover{
border-radius: 6px;
border: 1px solid #CCCCCC;
border-left:0px solid #CCCCCC;
height:34px;
box-shadow:none;
background: #FFFFFF;
}
.searchformbutton:focus{
border-radius: 6px;
border: 1px solid #CCCCCC;
border-left:0px solid #CCCCCC;
height:34px;
box-shadow:none;
background: #FFFFFF;
}
.form-inline.topsearchform{
width:300px;
}
Here is a jsFiddle: http://jsfiddle.net/dpLgc/
Any help as to why it looks like this in IE would be greatly appreciated. Note in the default Bootstrap 3 code, it looks like in IE, so it must be somewhere in this code :(
I'm working on a digital textbook feature that would allow the student to click a link to open up a simple div form for them to input their answer to that specific question. The pop-up form is just simple HTML/CSS with some jQuery UI to hide, show, and make it draggable. Here's the twist. I've got multiple questions that each need to be attached to a unique div. No problem, I thought. I'll just set each a href to link back to a unique ID that I've assigned within the DIV. Problem is, I can't seem to target the proper DIV with its corresponding a href. Instead the same set of questions appear no matter which link is clicked. This seems super simple and I'm probably overcomplicating it. What can I do here?
HTML:
<div id="draggable" class="messagepop pop">
<form method="post" id="new_message" action="/answers">
<p><label for="body">What type of person is Carsten?</label><textarea rows="15" name="body" id="body" cols="55"></textarea></p>
<p><label for="body">How do you know?</label><textarea rows="15" name="body" id="body" cols="55"></textarea></p>
<p><center><input type="submit" value="Submit" name="commit" id="message_submit"/> or <a id="hide" href="#">Cancel</a></center></p>
</form>
</div>
<div id="draggable" class="messagepop pop">
<form method="post" id="new_message" action="/answers">
<p><label for="body">What can you learn about an active volcano from the photograph?</label><textarea rows="15" name="body" id="body" cols="55"></textarea></p>
<p><center><input type="submit" value="Submit" name="commit" id="message_submit"/> or <a id="hide" href="#">Cancel</a></center></p>
</form>
</div>
Draw Conclusions What kind of person is Carsten? How do you know?
Use Text Features What can you learn about an active volcano from the photograph?
Where the first a href needs to open the first div and the second a href opens the second div, etc., etc.
CSS:
.messagepop {
overflow-y: auto;
overflow-x: hidden;
cursor:default;
display:none;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
text-align:left;
width:394px;
height: 335px;
z-index:50;
padding: 25px 25px 20px;
background-color: #fff;
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
-moz-border-radius: 4px 4px 4px 4px;
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
-webkit-border-radius: 4px 4px 4px 4px;
border-color: #E5E5E5 #DBDBDB #D2D2D2;
border-style: solid;
border-width: 1px;}
JS:
$(document).ready(function() {
$('.show').click(function() {
if ( !$(this).next('div').is(':visible') ) {
$(".messagepop").slideFadeToggle();
$(this).next('div').slideFadeToggle();
}
});
$('.hide').click(function() {
$(this).parent().slideFadeToggle();});
$.fn.slideFadeToggle = function(easing, callback) {
return this.animate({ opacity: 'toggle', height: 'toggle' }, "fast", easing, callback);};
$(function() {
$("#draggable").draggable();});
Thank you for your advice and for ironing out my poorly written method. It seems you've got it working.
I've since discovered a jQuery Mobile solution that is much easier than what I was trying to pull together.
For future viewers, it would simply look like this.
Draw Conclusions
Use Text Features
<div data-role="popup" id="popup1" class="ui-content" data-position-to="window">
Close
<p>What kind of person is Carsten?</p>
<input type="text"/>
<p>How do you know?</p>
<textarea></textarea>
</div>
<div data-role="popup" id="popup2" class="ui-content" data-position-to="window">
Close
<p>What can you learn about an active <mark><b>volcano</b></mark> from the photograph?</p>
<textarea></textarea>
</div>
The logic here makes a lot more sense to me and there's the added benefit of ensuring it will work properly on mobile devices. Then if you want to make it draggable, just drop in:
<script>
$(function() {
$(".ui-content").draggable();
});
</script>
And then if you want it to be draggable on mobile (remember, jQuery UI isn't natively supported on mobile), you'll have to call up a hack of sorts. I like Touch Punch.
You may run into issues with form inputs when using Draggable combined with Touch Punch, but that's a story for another thread.
Here is a demo: http://jsfiddle.net/ebNsz/
I've set id:s for the question-div:s and target them with the 'href' attribute in the 'a' elements. Not sure what you wanted to do with the 'slideFadeToggle' function, so i used 'fadeToggle' instead.
HTML:
<div id="q1" class="messagepop">
<form method="" id="form1" action="/answers">
<label for="answer1">What type of person is Carsten?</label><textarea name="answer1" class="answer"></textarea>
<label for="answer2">How do you know?</label><textarea name="answer2" class="answer"></textarea>
<div>
<input type="submit" value="Submit" name="submit" /> or <a class="close" href="">Cancel</a>
</div>
</form>
</div>
<div id="q2" class="messagepop">
<form method="" id="form2" action="/answers">
<label for="answer1">What can you learn about an active volcano from the photograph?</label><textarea name="answer1" class="answer"></textarea>
<div>
<input type="submit" value="Submit" name="submit" /> or <a class="close" href="">Cancel</a>
</div>
</form>
</div>
<p>Draw Conclusions What kind of person is Carsten? How do you know?</p>
<p>Use Text Features What can you learn about an active volcano from the photograph?</p>
jQuery: (jsFiddle doesn't support .draggable(), so i commented out the first line and added the second.)
$(function() {
/* $("div.messagepop").draggable().hide();*/
$("div.messagepop").hide();
$("a.toggle").click(function(e)
{
e.preventDefault();
var targetpop = $(this).attr('href');
$(targetpop).siblings("div.messagepop").fadeOut();
$(targetpop).fadeToggle();
});
$("a.close").click(function(e)
{
e.preventDefault();
$(this).closest("div.messagepop").fadeToggle();
});
});
CSS:
.messagepop {
position: absolute;
top: 20%;
left: 50%;
z-index: 50;
margin-left: -197px;
text-align: center;
width: 394px;
height: 335px;
padding: 25px 25px 20px;
background-color: #fff;
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
border-color: #E5E5E5 #DBDBDB #D2D2D2;
border-style: solid;
border-width: 1px;
}
label {
display: block;
}
textarea {
width: 75%;
height: 5em;
margin: 0 0 1em 0;
}