read from here
width:auto
or any %-value to make sure that the layout makes use of the available width of the browser windows automatically.selector { min-height:500px; height:auto !important; height:500px; }
Some browsers ship with default stylesheets that are simply horrible. One notorious problem, for example, is the <table> tag that forgets to inherit font settings from its parents. Meaning that if you set the font size on the <body> tag, the content of your tables will still not change size.
My suggestion is to start your CSS file with this line:
@import url("http://yui.yahooapis.com/2.6.0/build/reset-fonts-grids/reset-fonts-grids.css");
This imports the Yahoo YUI reset CSS file in front of your own [of course, the version number for that might change, so check the YUI web site]. The above doesn’t work with old browsers (NS4 and IE4, for example), but we can safely ignore those now.
We can talk about this forever, but you probably don’t care. My suggestion for you is to do the following: start your CSS stylesheet with
html { font-size: 62.5%; }
This apparently bizarre number brings your standard font size so that 1em = 10px (This is because the default size for ‘medium’ text in all modern browsers is 16px). And from that point on, you can easily use ‘em’ all over your stylesheet, even if you wanted to use pixels, simply by dividing by 10.
Inside your new extension folder, create another folder called chrome
, and inside the chrome
folder create a folder called content
.
Inside the root directory of your extension folder, create two new empty text files, one called chrome.manifest
and the other called install.rdf
.
radius
refers to the value we passed to the Circle()
constructor function, not the value of the object. So when we change the object's radius
, the methods getArea()
and geCircumference()
, keep on using the old radius. So, we really shouldn't use just plain old radius
. Instead, we need to use this.radius
, as it refers to the current object's radius, whether this property changes after the object is created or not.Ok, so now we've created a self-contained object constructor - the function that defines an object. Let's look at another way we can create functions inside our Circle()
constructor:
function Circle(radius){
this.radius = radius;
this.getArea = function(){
return (this.radius*this.radius*3.14);
}
this.getCircumference = function(){
var diameter = this.radius*2;
var circumference = diameter*3.14;
return circumference;
}
}
var bigCircle = new Circle(100);
var smallCircle = new Circle(2);
alert(bigCircle.getArea()); // displays 31400
alert(smallCircle.getCircumference()); // displays 12.56