I'm trying to make the checkbox bigger in size. The regular size is too small
Try CSS 'transform'
input[type=checkbox] {
-ms-transform: scale(2);
-moz-transform: scale(2);
-webkit-transform: scale(2);
-o-transform: scale(2);
transform: scale(2); }
But it will not work on IE8.
http://www.w3schools.com/cssref/css3_pr_transform.asp
You can make use of the images to change the style of checkboxes.
You can also use the following CSS which has been tested in Chrome. But this won't work in Firefox:
input[type='checkbox'] {
width: 4em;
height: 4em;
}
For a demo visit: http://www.456bereastreet.com/lab/styling-form-controls-revisited/checkbox/
This is tough to achieve if you want to maintain cross-browser compatiblity.
You may want to consider an input replacement plugin such as this one.
http://blogs.digitss.com/javascript/jquery-javascript/jquery-fancy-custom-radio-and-checkbox/
Related
I have website www.stanosimkovic.sk and i have problem with vertical positioning right element with text on main page in IE browser. In another browsers it load correctly. Can somebody help me how to fix this issue.
I think problem is somewhere in CSS
.alignMiddle {
position: relative;
top: 50%;
transform: translateY(-50%);
}
But dont know how resolve it, because in Chrome Opera etc. its OK.
Depending of the version of IE, the transform property might not work. So what you have to do is add the vendors prefix. So it should look like this (-ms- is for IE) :
.alignMiddle {
position: relative;
top: 50%;
transform: translateY(-50%);
-ms-transform: translate(-50%);
-webkit-transform: translate(-50%);
-moz-transform: translate(-50%);
}
Hope it helps !
I'm making a website that contains many skewed elements, like this:
This isn't too bad, there are CSS transforms that could skew it. But how about this:
The image isn't distorted, just the frame is cropped in a skewed way. What's the easiest/best way to do this?
I think this should work for you. As a Mark commented on, clip-path is a nice way to go. There are tools for getting just the right path such as Clippy. Once you've got the path, you drop it right into your code. In my demo, I used it on the div wrapping the image, rather than on the image itself. I did it this way to keep border effects—added via pseudo-class—on top of the image.
Demo: http://codepen.io/antibland/pen/eZKxNa
I ended up using the following. It creates a skewed parent, then unskews the child, centering it and making it big enough to fill the skew's stick-out bits.
HTML
<div class="skewed">
<img src="images/sad-kid.jpg">
</div>
CSS
div.skewed {
position: relative;
height: 140px;
transform: skew(-2deg) rotate(2deg);
-webkit-transform: skew(-2deg) rotate(2deg);
-moz-transform: skew(-2deg) rotate(2deg);
overflow: hidden;
}
div.skewed > * {
width: 110%;
position: absolute;
top: 50%;
transform: skew(2deg) rotate(-2deg) translateY(-50%);
-webkit-transform: skew(2deg) rotate(-2deg) translateY(-50%);
-moz-transform: skew(2deg) rotate(-2deg) translateY(-50%);
}
OUTPUT
This is similar to Andy Hoffman's method, but supports a greater number of browsers.
I have been having problems with a Wordpress theme where the portfolio grid doesn't seem to be spanning 100% across the page.
You can find the problem here after the 'crashes' image box - http://beta.audiopeak.net
Any help with amending this issue would be great.
I made these changes to the CSS (screen.css) and it seemed to work (but with limited testing).
Let me know if they work for you.
.one_fourth.gallery4:hover div.thumb_content {
opacity: 1;
-webkit-transform: translateY(-20px);
-moz-transform: translateY(-20px);
-ms-transform: translateY(-20px);
transform: translateY(-20px);
}
.one_fourth.gallery4 img{
width: 100%;
}
.page_content_wrapper.full_width {
width: 102%;
}
Folks, I have text on a div that has transform: rotate(3deg). In Firefox, the text is rendered wavy. Removing the transform to the div fixes the waviness. Is there a way for me to have my cake and eat it too?
HTML:
<div class="card turn-right">
<div class="card-text">
<p>Blah. Blah. Blah.</p>
</div>
</div>
CSS:
.card {
display: block;
width: 550px;
height: 375px;
}
.turn-right {
-webkit-transform: rotate(3deg);
-moz-transform: rotate(3deg);
-ms-transform: rotate(3deg);
-o-transform: rotate(3deg);
transform: rotate(3deg);
}
Edit:
Additional information: I have to use a #font-face for this project.
Screenshot:
Try adding perspective
.turn-right {
-webkit-transform: perspective(9999px) rotate(3deg);
transform: perspective(9999px) rotate(3deg);
}
No need for -moz-transform in modern browsers
By the way, the same bug is present in webkit browsers.
Why does this work ?
I don't have a real answer, because I don't have the source for the browser. But my guess is the following. The browsers have a very good rendering engine, that can do lots of things, and does it pretty well. But doing all this is most of the time expensive (read: makes the browser slow). So, most of the time it is trying to guess: is this really necessary ? Do I really need to calculate the xxxx of the yyyy in the zzzz to display this ?
And some of the bugs come from that guess being incorrect, and omiting a necesary calculus.
The solution then, is to put there something that makes the browser rendering engine think "wait, I really need to calculate that, that is not the easy case".
Also in this line are fixes like translate3d(0,0,0) or translateZ(0) or backface-visibility hidden . What is the sense in translating something 0px ? They force the browser to do something the complicated way instead of the easy way, and solve - optimize the result.
well, I normally find the answer to my questions here but this time I didn't so I will now ask my first one here! :)
I have some rotated text on my page and it is positioned using position:absolute, like below:
.rotate-box .rotate-text{
display: block;
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: rotate(90deg);
position: absolute;
left: -45px;
top: 170px;
}
<div class="rotate-box">
<span class="rotate-text">Rotated text</span>
</div>
This works fine on all browsers (with webkit) except for Safari and Chrome where the text is displayed about 90px lower than in the other browsers.
To prevent this I have added:
#media screen and (-webkit-min-device-pixel-ratio:0){
.rotate-text {top: 80px !important;}
}
Now the text is in the correct place in all browsers but this doesn't feel right to me... Am I missing something here?
I hate adding browser exception code, it tends to come back and bite you in the long run... :o
Regards,
Anders
Change this line:
-webkit-transform: rotate(90deg);
to
-webkit-transform: rotate(90deg) translate(-100px, 16px);
As you know, this line is only used by the webkit browsers (Safari, Chrome)
You'll probably have to play around with the exact px figures, but then you can get rid of the extra #media screen tag.
Look into transform-origin. Basically, you should be able to do transform-origin: 0 0; (with all the prefixes, of course), and it'll hook the rotate to the top left, which sounds like what you want.