Checkboxes doesn't appear properly when using Chrome and zoom out to 75% or less. I'm also using AngularJS latest version. In FireFox and Internet Explorer they appear properly.
I tried to fix this problem with:
input[type=checkbox] {
-webkit-appearance:checkbox;
}
but this doesn't help.
Here how it looks like:
The checkboxes are custom and there is 1 span and inside 2 divs. Here is the code:
.ckeckmark {
display: inline-block;
width: 18px;
height: 18px;
-ms-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
}`
.ckeckmark > .stem {
position: absolute;
width: 1px;
height: 11px;
background-color: #1C4A9E;
left: 8px;
top: 2px;
}
.ckeckmark > .kick {
position: absolute;
width: 5px;
height: 1px;
background-color: #1C4A9E;
left: 3px;
top: 12px;
}
<span ng-class="{ckeckmark: resident}">
<div class="stem"></div>
<div class="kick"></div>
</span>
.stem and .kick are 2 divs next to each other inside .checkmark span class.
After research i noticed that Google Chrome displays a web page OK at 100% zoom (and above) but when the zoom level is less than 100% (e.g. 90%) padding get changed. A moves from the right-hand-side of the screen to the left hand side.
Any help/suggestions?
So I popped this into a fiddle and I think I saw your problem. It took zooming out to 33% before the checkmark disappeared at jsfiddle as opposed to your 75%.
The solution I used was to use borders on the actual stem and kick instead of using a background on those elements.
.ckeckmark {
display: inline-block;
width: 18px;
height: 18px;
border: 1px solid black;
-ms-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
}
.stem {
position: absolute;
width: 1px;
height: 11px;
border-left: 1px solid red;
left: 8px;
top: 2px;
}
.kick {
position: absolute;
width: 5px;
height: 7px;
border-top: 1px solid red;
left: 3px;
top: 12px;
}
I have not tested this in other browsers, but I zoomed out all the way to 25% and I still saw the checkmark.
Fiddle here: http://jsfiddle.net/Lvc0u55v/1658/
Related
I would like some help over something thats driving me nuts so hard hahaha. So I have this checkboxes like this:
So, I have this design that my UX & UI colleague made for this project that I need something similar to this:
As you can see in the image above, I need to implement something where there`s no checkboxes and at the moment I select an Icon a color blue must show on the border as letting the user know that option has been selected.
The resource Im using for this is materializeCSS check boxes and my current CSS is the below:
/*Checkboxes*/
[type="checkbox"]:checked + span:not(.lever):before {
top: -4px;
left: -5px;
width: 12px;
height: 22px;
border-top: 2px solid transparent;
border-left: 2px solid transparent;
border-right: 2px solid #2372bd;
border-bottom: 2px solid #2372bd;
-webkit-transform: rotate(40deg);
transform: rotate(40deg);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-transform-origin: 100% 100%;
transform-origin: 100% 100%;
}
/*Checkboxes*/
[type="checkbox"] + span:not(.lever):before, [type="checkbox"]:not(.filled-in) + span:not(.lever):after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 18px;
height: 18px;
z-index: 0;
border: 2px solid #888888;
border-radius: 1px;
margin-top: 3px;
-webkit-transition: .2s;
transition: .2s;
}
//This are the current circles that wrapps the icons
.services-circle{
border: 1px solid #858585;
width: 45px;
margin-top: 10px;
margin-bottom: 20px;
height: 45px;
border-radius: 50%;
}
//Current HTML
<label>
<div class="services-circle center-align">
<i class="material-icons-two-tone px32 no-margin-top-bottom">fireplace</i>
<input name="property[services_attributes][0][gas]" type="hidden" value="0"><input
type="checkbox" value="1" name="property[services_attributes][0][gas]"
id="property_services_attributes_0_gas">
<span for="gas">Gas</span>
</div>
</label>
NOTE: If I select the icon or circle it gets checkboxed, so I guess thats nice
So, is there's some cool resource out there in the lost internet to do something like this? Or if have some basic code where pushes me to achieve something like this, that would be awsome! I will appreciate your help!
Set the checkboxes to display: none;
I have a back-button image as div element within another. The text in #program_title is dynamically changing and so is its width. I would like to prevent the overlap of the back-button image with the text, but have been unsuccessful.
So far - I have tried floating the image left or right, styling both to display: inline-block, changing the margins, and using <span> instead of <div>. If I change the position of #program_title to relative, this somehow interferes with centering the element. I think there is something simple that I am missing. Any suggestions to resolve this issue?
#map {
position:absolute;
left:25%;
top:0;
bottom:0;
width: 75%;
}
#program_title{
position: absolute;
z-index: 20202020;
background: rgba(12, 12, 12, 0.99);
color: #fff;
font-weight: 600;
font-size: 18px;
display: inline-block;
left: 50%;
width: auto;
top: 1%;
text-align: center;
padding: 5px 10px;
border-radius: 10px;
-webkit-transform: translateX(-50%);
-moz-transform: translateX(-50%);
-ms-transform: translateX(-50%);
-o-transform: translateX(-50%);
transform: translateX(-50%);
}
#go-back {
content:url('./back-button.svg');
position: absolute;
color: #fff;
border-radius: 5px;
left: 1%;
height: 20px;
width: 20px;
opacity: 0.9;
float: left;
display:inline-block;
}
<div id='map'>
<div id='program_title'>
<div id ='go-back'></div>
<span>TITLE</span>
</div>
</div>
You should not keep the position absolute in #go-back as due to this particular attribute the back button has an absolute position irrespective of any other element on or around it. This would seem like the other elements are overlapping the back button(in your case the title), but actually if you scroll down the page(i.e. if your page is large enough to be scrolled down) you will notice that the position of the back button does not change. So change it to relative or remove the position attribute in style.
You have lots of code there that are NOT required! If the problem is with the image then a simple float would do the job. and it doesn't matter if the parent's div position is absolute or not! here I make a fiddle.
and all the CSS you need. and of course some of it is for style and you could erease it.
#map {
position:absolute;
left:25%;
padding: 10px;
border: 1px solid black;
border-radius: 5px;
}
#go-back {
content:url('http://img.freepik.com/free-icon/back-button_318-69320.jpg?size=338&ext=jpg');
float: left;
display:inline-block;
width: 25px;
height: 25px;
margin-right: 10px;
}
#program_title {
line-height: 25px;
}
You need to remove position:absolute; from #go-back and instead use display:inline-block; or float:left;
#go-back {
content:url('https://cdn2.iconfinder.com/data/icons/arrows-and-universal-actions-icon-set/256/left_circle-128.png');
color: #fff;
border-radius: 5px;
height: 20px;
width: 20px;
opacity: 0.9;
display:inline-block; /* Or float:left */
}
jsFiddle
Hello I was recently browsing around some demo for websites for client. And saw a really cool thing I liked. So I try to inspect in the browser to see if I replicate the effect on my own. And I have no idea how they did it.
here is the link to the demo
http://www.templatemonster.com/demo/45057.html
And here is a n image to show what I'm talking about.
They have these squares with an overflow at the bottom looking like multiple elements.
I was able to grab the HTML/CSS and replicate the just one box without the overflow. But I can't figure out how to make it look like stacked boxes, nor can I find where the code is.
I tried to replicate using JSFidle as you can see here
HTML
<div class="span2"><div class="service-box boxed green"><figure class="icon"><i class="icon-file-alt"></i></figure><div class="service-box_body"><h2 class="title">Accounting valuations</h2></div></div> </div>
.service-box.boxed {
border-radius: 0px;
box-shadow: none;
padding: 25px 15px;
margin-bottom: 30px;
text-align: center;
position: relative;
background: none repeat scroll 0% 0% #F1F6F9;
overflow: visible;
border: 1px solid #C5D0D2;
}
http://jsfiddle.net/w1defmkz/
You're pretty close but missing the :before and :after pseudo elements:
.service-box.boxed:before, .service-box.boxed:after {
content: "";
display: block;
position: absolute;
left: 1px;
right: 1px;
bottom: -4px;
height: 2px;
background: #f1f6f9;
border: 1px solid #c5d0d2;
border-top: none;
}
.service-box.boxed:before, .service-box.boxed:after {
content: "";
display: block;
position: absolute;
left: 1px;
right: 1px;
bottom: -4px;
height: 2px;
background: #f1f6f9;
border: 1px solid #c5d0d2;
border-top: none;
}
.service-box.boxed:after {
left: 3px;
right: 3px;
bottom: -7px;
}
Here's an updated fiddle: http://jsfiddle.net/w1defmkz/1/
Well, The user has added two more divisions, made them absolute.
You see, the whole span (class = "span2") is positioned relative.
This is the css for the one of them...
content: "";
display: block;
position: absolute;
left: 1px;
right: 1px;
bottom: -4px;
height: 2px;
background: #f1f6f9;
border: 1px solid #c5d0d2;
border-top: none;
Js Fiddle: http://jsfiddle.net/3my6rhgL/
I having a small problem in getting the right character for my CSS content element. What I wanted is dots under my heading, 3 dots to be specific and so I have the following CSS:
.dotted-effect::before{
position: absolute;
top: 80%;
left: 50%;
content: '.';
font-size: 1.2em;
-webkit-transform: translateX(-50%);
-moz-transform: translateX(-50%);
transform: translateX(-50%);
pointer-events: none;
color: #444;
text-shadow: 20px 0 #444, -20px 0 #444;
-o-transition:.3s;
-ms-transition:.3s;
-moz-transition:.3s;
-webkit-transition:.3s;
transition:.3s;
}
The problem is in the way the CSS dot is displayed. Have a look at how it looks:
Notice how the dots look a bit squarish and tiny.
Now I'd like my dots to be circular and a bit bold: not ugly bold, but slightly bold.
I tried looking up Stack Overflow and a lot of people had the same problem:
This thread addresses my problem in a few ways. The problem is I am a bit specific about how I want my dots to be, and so I cannot settle for those tiny small dots. I also went through a lot of HTML ASCHII charts and none of them had what I was looking for.
What can I do next to achieve my goal?
How about background + border-radius?
http://jsfiddle.net/z7v6xk44/1/
<div class="dots"></div>
.dots, .dots:before, .dots:after {
width: 4px;
height: 4px;
background: black;
border-radius: 50%;
}
.dots{
margin: 0 auto;
position: relative;
display: inline-block;
}
.dots:before {
content: '';
position: absolute;
left: -10px;
}
.dots:after {
content: '';
position: absolute;
right: -10px;
}
The title says it all, I've just discovered that IE (9 - 11) automatically applies about 50% opacity to any element's border with border-style: dotted.
The weirdest thing is, it only happens on dotted in particular, solid and dashed are fine.
You can test it yourself: http://jsfiddle.net/ptv74f4q/1/
Any ideas?
This appears to be due to IE anti-aliasing the dotted border. If you make the border-width bigger than 1px (say 5px) the border will appear white again.
One way to get around this would be to overlay some pseudo elements with the same dotted border on top to counteract the opacity:
div {
width: 200px;
height: 200px;
background: #000;
}
span {
transform: rotate(0deg);
display: inline-block;
width: 180px;
height: 85px;
line-height: 85px;
text-align: center;
margin: 8px 8px 0 8px;
border: #fff 1px solid;
color: #fff;
position: relative;
}
span.dotted {
border-style: dotted;
}
span.dotted::before, span.dotted::after {
border: #fff 1px dotted;
content: "";
height: 100%;
left: -1px;
position: absolute;
top: -1px;
width: 100%;
}
<div>
<span>I'm with normal border</span>
<span class="dotted">I'm with dotted border</span>
</div>
JS Fiddle: http://jsfiddle.net/oyrbLyjc/1/
Alternative method
Alternatively you could try using border-image. There are online tools (e.g. https://developer.mozilla.org/en-US/docs/Web/CSS/Tools/Border-image_generator) that would be able to help you generate a similar border using this method.