Click button copy to clipboard

Edit as of 2016 As of 2016, you can now copy text to the clipboard in most browsers because most browsers have the ability to programmatically copy a selection of text to the clipboard using document.execCommand(“copy”) that works off a selection. As with some other actions in a browser (like opening a new window), the copy to … Read more

Resource interpreted as stylesheet but transferred with MIME type text/html (seems not related with web server)

i’d like to start by understanding the problem Browsers make HTTP requests to servers. The server then makes an HTTP response. Both requests and responses consist of a bunch of headers and a (sometimes optional) body with some content in it. If there is a body, then one of the headers is the Content-Type which describes what … Read more

CSS3 Transition not working

Transition is more like an animation. So you need to invoke that animation with an action. Also check for browser support and if you still have some problem with whatever you’re trying to do! Check css-overrides in your stylesheet and also check out for behavior: ***.htc css hacks.. there may be something overriding your transition! You should … Read more

Maintain the aspect ratio of a div with CSS

Just create a wrapper <div> with a percentage value for padding-bottom, like this:  Run code snippetExpand snippet It will result in a <div> with height equal to 75% of the width of its container (a 4:3 aspect ratio). This relies on the fact that for padding : The percentage is calculated with respect to the width of the generated box’s containing block … Read more

Flexbox: center horizontally and vertically

I think you want something like the following.  Run code snippetExpand snippet See demo at: http://jsfiddle.net/audetwebdesign/tFscL/ Your .flex-item elements should be block level (div instead of span) if you want the height and top/bottom padding to work properly. Also, on .row, set the width to auto instead of 100%. Your .flex-container properties are fine. If you want the .row to be centered vertically in the view port, assign … Read more

How to reference nested classes with css?

In CSS, classes need to be prefixed by a ., ids need to be prefixed by #, and elements don’t need to be prefixed at all. This is how you need to declare your CSS: Note that box1 and box-body are both classes, while i is an element. Example: I have listed three different <div> elements. This is how they would be accessed in CSS: } // second div … Read more

Should I use px or rem value units in my CSS?

TL;DR: use px. The Facts First, it’s extremely important to know that per spec, the CSS px unit does not equal one physical display pixel. This has always been true – even in the 1996 CSS 1 spec.CSS defines the reference pixel, which measures the size of a pixel on a 96 dpi display. On a display that has a dpi substantially different than 96dpi (like … Read more