Showing posts with label Html. Show all posts
Showing posts with label Html. Show all posts

Monday, February 9, 2015

Font-size property dynamically proportioned to the browser window size

It's called viewport. It's the same to say browser window size.
We can assign to the font-size property a value expressed in percentage.
For example if the viewport width is 50 cm, assinging a font-size of 1vw matches to 0.5 cm.
So we give it simply:
a {
    font-size: 1vw;
}

Others use of dinamical font-size use should be:
- the vh: viewport height - for example: font-size:1vh;
- the vmin: the smaller between vw or vh - for example: font-size:1vmin;
- the vmax: the larger between vw or vh - for example: font-size:1vmax;

Bye...

Tuesday, March 11, 2014

HTML: center horizzontally body content(in according to css3)

Insert the content of your body element into this div...

<div style="display: flex;flex-direction: row;flex-wrap: wrap;justify-content: center;align-items: center;">
[..............Your content.......]
</div>

Bye...

Friday, February 10, 2012

Bind or unbind html form to enter key pression

You should need to force the enter key pression, on a html form, to a javascript function(instead of the tag attribute action content).

$(document).ready(function(){
    $("#recoverUsernameFormId").bind("keypress", function(e) {
        if (e.keyCode == 13) {
            callYourFuncion();
            return false;
        }

    });
});


At the same way, you should need to unbind the enter key pression to the html form.


$(document).ready(function(){
    $("#recoverUsernameFormId").bind("keypress", function(e) {
        if (e.keyCode == 13) {
            return false;
        }

    });
}); 


Bye...

Tuesday, December 6, 2011

Simple browser cache bypass

I need a quick solution to go over a browser page caching problem...
After some research..... I look for this quick solution....
Add a random argument to your url..:

var forwardUrl = 'http://yourcachedpage.html?' + (new Date()).getTime();

Bye...