-- paste --Step 3: All we have to do now is to put our CSS and HTML code together. Fortunately we can use the
body
element as .Frame, so there is no need for an extradiv
tag or so.<!DOCTYPE HTML> <html> <head> <style type="text/css"> html, body { height: 100%; margin: 0pt; } .Frame { display: table; height: 100%; width: 100%; } .Row { display: table-row; } .Row.Expand { height: 100%; } </style> </head> <body class="Frame"> <header class="Row"><h1>Catchy header</h1></header> <section class="Row Expand"><h2>Awesome content</h2></section> <footer class="Row"><h3>Sticky footer</h3></footer> </body> </html>Note: Remember to include the html5shiv workaround in your page (and define appropriate CSS styles) if you want to use HTML5 tags in IE8 and below. Or simply use
div
tags instead ofheader
,section
andfooter
.A word on older browsers
The code above will work even with older versions of Firefox, Opera and Safari, so there is nothing to worry about here, but unfortunately Internet Explorer 7 and below don’t know anything about
display:table
ordisplay:table-row
, so we go the way of graceful degradation here.The first thing we have to to is, to prevent the margins of elements inside the row from being outside of it, by adding
overflow:hidden
to the.Row
style.That gives us quite acceptable results, but the footer will always be outside of the window due to the 100% height of the
.Frame
and the.Row
. The solution is to setheight:100%
in a way that all Internet Explorer versions below 8 won’t recognize. I’m using the (valid)html>/**/body
CSS hack to accomplish this, but you might also use conditional comments if you feel better that way. However, here is the fixed CSS:.Frame { display: table; width: 100%; } html>/**/body .Frame { height: 100%; } .Row { display: table-row; overflow: hidden; } html>/**/body .Row.Expand { height: 100%; }I guess it shouldn’t be too complicated to create a sticky footer by adjusting the height of
.Row.Expand
with some little Javascript.
Friday, October 21, 2011
Sticky Footer & Variable Height - modern CSS
Copy & Pasted from http://pixelsvsbytes.com/blog/2011/09/sticky-footers-the-flexible-way/ Page was down for me, so salvaged this from Bing search cache (Google cache didn't have):
-- cut --
Tuesday, September 27, 2011
WP: Turn Off Comments / Ping Backs by Default from Pages
Turn Off Comments / Ping Backs by Default from Pages
Themes functions.php or yourplugin.php:
Snippet above turns off the check boxes only from New Pages, any existing pages must be unchecked manually.
Themes functions.php or yourplugin.php:
// This is valid hack as long as "wp-admin/includes/post.php" // `get_default_post_to_edit()` keeps calling `apply_filter()` for // `default_content` *after* `comment_status` and `ping_status` setting.
function my_disable_pages_default_commenting($content, $post) { if ($post->post_type == 'page') { $post->comment_status = "closed"; $post->ping_status = "closed"; } return $content; } add_filter('default_content', 'my_disable_pages_default_commenting', 1, 2);
Snippet above turns off the check boxes only from New Pages, any existing pages must be unchecked manually.
Friday, September 23, 2011
Duplicate All Pages (in-place) in Acrobat X
This is just a small JavaScript extension to Acrobat X that allowes to Duplicate all pages in-place there exists another version which used extractPages and I didn't like that behavior so I wrote own.
First elevate privileges of the JavaScript programs:
Now you should be able to access the "Duplicate all pages (in-place)" under "Edit" menu item. If you can't see the item remember to restart Acrobat.
First elevate privileges of the JavaScript programs:
- Right click on document, and choose "Page Display Preferences"
- Choose "JavaScript" from the left.
- Check the "Enable menu items JavaScript execution privileges".
%appdata%\Adobe\Acrobat\10.0\JavaScripts
folder:app.addMenuItem({ cExec: "duplicatePagesInPlace();", cParent: "Edit", cName: "Duplicate all pages (in-place)" }); function duplicatePagesInPlace() { var doc = this, pages = this.numPages; for (var i = pages - 1; i >= 0; i--) { doc.insertPages({ cPath: doc.path, nStart : i, nEnd : i, nPage : i }); } }
Now you should be able to access the "Duplicate all pages (in-place)" under "Edit" menu item. If you can't see the item remember to restart Acrobat.
Saturday, July 30, 2011
Windows 7 - Photo Viewer was really slow
Windows 7 Photo Viewer was acting really slow for loading images, this fixed it:
That did the trick.
- Go to Color management (Desktop -> Screen Resolution -> Advanced Settings -> Color Management -> Color Management -> Advanced (tab) -> Change System Defaults)
- Remove all profiles from all screens, and add single profile per display. (I chose sRGB virtual device mode profile.)
- Check the colors in Photo Viewer if the colors are fine then you chose good profile.
That did the trick.
Saturday, January 22, 2011
Where Django & PyDev fails
Don't get me wrong, I like Python, PyDev and Django. But I simply hate the small problems like this:
I forget something simple, like what was the order of return tuple of
Same thing with the god damned exception handling. I don't think I've seen any official package that lists the exceptions given function may rise. All functions should have a good doc-strings that lists parameters, exceptions (including nested) and in case the return value is tuple or something non obvious the order of items in tuple.
Simply, it takes ages to open up the webpage, and browse to right place of docs. There exists a fix, but PyDev does not support it. It's the official objects.inv for Django (sphinx mapping file from keyword to URI).
I forget something simple, like what was the order of return tuple of
get_or_create
? Then I try to look the tip of the function, and what do I get? The useless **kwargs
passing.Same thing with the god damned exception handling. I don't think I've seen any official package that lists the exceptions given function may rise. All functions should have a good doc-strings that lists parameters, exceptions (including nested) and in case the return value is tuple or something non obvious the order of items in tuple.
Simply, it takes ages to open up the webpage, and browse to right place of docs. There exists a fix, but PyDev does not support it. It's the official objects.inv for Django (sphinx mapping file from keyword to URI).
Subscribe to:
Posts (Atom)