css-hack

radio button (checkbox hack)

跟風遠走 提交于 2020-01-11 13:05:40
问题 I'm trying to use the CSS radio button hack to reveal a hidden div, but I cannot get it to appear when clicked. With the current code below it is hidden, and nothing happens when I click the check box. I intend to add similar boxes (and later hide them) to display a few tabs of light content. Can someone please offer some aid? Here is the html (only the first box is written): <section class="panel clearfix skillsBox"> <div class="wizard wizard-vertical clearfix" id="wizard-2"> <ul class=

How to run a function when CSS stylesheet finishes loading

别等时光非礼了梦想. 提交于 2020-01-06 05:43:04
问题 How do I run a function when a stylesheet finishes loading? Here is my code.. var d = document, css = d.head.appendChild(d.createElement('link')) css.rel = 'stylesheet'; css.type = 'text/css'; css.href = "https://unpkg.com/tachyons@4.10.0/css/tachyons.css" 回答1: According to MDN's <link>: The External Resource Link element, You can determine when a style sheet has been loaded by watching for a load event to fire on it; similarly, you can detect if an error has occurred while processing a style

What is the scope of the * CSS hack?

落爺英雄遲暮 提交于 2019-12-30 09:53:28
问题 I have been looking at a hack to solve a CSS problem I have. I haved used one to create a custom rule for Internet Explorer. margin-top:45px; *margin-top:0px; Does this hack apply to all IE browsers? Does this hack appear in any versions of Firefox or Safari? 回答1: This applies to IE7 and below. But be aware that this is not valid CSS , and it could break at any time. See here for a more comprehensive list of the various CSS hacks and which browsers they affect. Although Internet Explorer 7

What is the scope of the * CSS hack?

拥有回忆 提交于 2019-12-30 09:53:06
问题 I have been looking at a hack to solve a CSS problem I have. I haved used one to create a custom rule for Internet Explorer. margin-top:45px; *margin-top:0px; Does this hack apply to all IE browsers? Does this hack appear in any versions of Firefox or Safari? 回答1: This applies to IE7 and below. But be aware that this is not valid CSS , and it could break at any time. See here for a more comprehensive list of the various CSS hacks and which browsers they affect. Although Internet Explorer 7

Clear float and prevent text wrap without hack

江枫思渺然 提交于 2019-12-24 22:52:03
问题 I am making a list of blurbs with images that can be used anywhere throughout our site. I want it to be really flexible, not have a specified width, and work properly with no image and with different sizes of images. If the text for a block is longer than its image, I want the text not to wrap under the image. I made a fiddle of pretty much exactly how I want it. https://jsfiddle.net/4dbgnqha/1/ Now the problem is, our senior developer told me I can't use overflow:hidden to clear the float or

forward slash in CSS? Is this some browser specific thing?

一世执手 提交于 2019-12-22 05:59:56
问题 I inherited a CSS stylesheet and in a few places it does things like: margin:7px 0 0 0; /margin-top:9px; or background: url(../images/list-hover.png) 0 0 no-repeat; /background:url(../images/lists-hover.png) 0 2px no-repeat; anyone know what that forward slash is doing? 回答1: It's to target LTE IE7. This hack isn't known as much as the IE6 underscore one. #myelement { background:red; /*Should show as red in all browsers, expect IE6 and IE7 because...*/ /background:yellow; /*IE7 should have

CSS specific rule for Opera 12? [duplicate]

ぃ、小莉子 提交于 2019-12-21 02:45:17
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to make CSS visible only for Opera Many times I need to use browser specific CSS rules to make the design look alike in every browser. Generally I need them for IE 7-8, but this time is for Opera, specifically Opera 12 and on. I found some solutions for Opera: Make CSS apply only for Opera 11? How to make CSS visible only for Opera But these only work for 11 or below... Is there a solution for Opera 12? 回答1:

The drag doesn't work when it has a siblings img in IE

北战南征 提交于 2019-12-20 06:15:45
问题 I'm trying to make a drag box with a sibling img and the 'move-obj' can be dragged.It runs correctly in other browser but IE(8,9,10). In IE, just while you hover the border can you drag the 'move-obj', but if you remove the tag 'img' it work correctly.I found that if I add a background-color to the 'move-obj',it will run correctly too, but it isn't what I want. Can somebody give me some advice?Here is the codepen <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document<

Future proof CSS hack for LTE Opera 10

醉酒当歌 提交于 2019-12-20 02:15:07
问题 I am currently using @media screen and (-webkit-min-device-pixel-ratio:0) to target Webkit browsers + Opera 9.2. Is there a safe* way to target Opera GTE 9.5 or LTE 10? * won't be picked up by another browser 回答1: That was hard but here it is. Works only in Opera gte 9.5 and lt 10.50: @media all and (resolution = 0dpi) { // exclude Opera 10.50 and higher :root #box { // you need to append :root to all selectors to exclude Opera lt 9.5 background: #f00; } } 回答2: * targets Opera 9 & below (and

Acceptable CSS hacks/fixes

心已入冬 提交于 2019-12-18 13:22:41
问题 Is there a list of 'good' clean CSS hacks, which are certain to be future-proof? For example, zoom:1 is safe, as long as it's only served to IE, and you remember it's there. The very common hack of using child selectors is not safe because IE7 supports them. Using height:1% just feels dirty (but that might just be me). I know of ie7-js, so IE6 bugs don't worry me much. Also, I'm not looking for a religious debate, just sources. Thanks for the replies - I've selected the one with best sources