xHTML/CSS: How to make inner div get 100% width minus another div width

The mysterious overflow: hidden; is your friend here. It stops elements adjacent to floats from extending behind the float — I think that’s the layout you’re looking for. Here’s some slightly edited HTML: I don’t think you can have # characters in your ids: <div id=”outer”> <div id=”inner1″> inner div 1. Some text… </div> <div … Read more

Where does PERSISTENT file system storage store with chrome?

For me, at least on Mac OSX, they’re stored under /Users/USERNAME/Library/Application Support/Google/Chrome/Default/File System for me. If you’re using profiles, there will be profile directories instead of Default. However, each origin’s saved files/folders are obfuscated under directories that won’t be easy for you to interact with. For debugging the Filesystem API, you have a few options: … Read more

3 column layout HTML/CSS

Something like this should do it: .column-left{ float: left; width: 33.333%; } .column-right{ float: right; width: 33.333%; } .column-center{ display: inline-block; width: 33.333%; } DEMO EDIT To do this with a larger number of columns you could build a very simple grid system. For example, something like this should work for a five column layout: … Read more

How to change scroll bar position with CSS?

Using CSS only: Right/Left Flippiing: Working Fiddle .Container { height: 200px; overflow-x: auto; } .Content { height: 300px; } .Flipped { direction: rtl; } .Content { direction: ltr; } Top/Bottom Flipping: Working Fiddle .Container { width: 200px; overflow-y: auto; } .Content { width: 300px; } .Flipped, .Flipped .Content { transform:rotateX(180deg); -ms-transform:rotateX(180deg); /* IE 9 */ … Read more

Get video duration when input a video file

In modern browsers, You can use the URL API’s URL.createObjectURL() with an non appended video element to load the content of your file. var myVideos = []; window.URL = window.URL || window.webkitURL; document.getElementById(‘fileUp’).onchange = setFileInfo; function setFileInfo() { var files = this.files; myVideos.push(files[0]); var video = document.createElement(‘video’); video.preload = ‘metadata’; video.onloadedmetadata = function() { window.URL.revokeObjectURL(video.src); … Read more

jquery submit form and then show results in an existing div

This code should do it. You don’t need the Form plugin for something as simple as this: $(‘#create’).submit(function() { // catch the form’s submit event $.ajax({ // create an AJAX call… data: $(this).serialize(), // get the form data type: $(this).attr(‘method’), // GET or POST url: $(this).attr(‘action’), // the file to call success: function(response) { // … Read more

CSS background image alt attribute

Background images sure can present data! In fact, this is often recommended where presenting visual icons is more compact and user-friendly than an equivalent list of text blurbs. Any use of image sprites can benefit from this approach. It is quite common for hotel listings icons to display amenities. Imagine a page which listed 50 … Read more