Home
Home Page
The menu of a choice in forms
The loader in HTML
Konfigurirovanie a site with the help of a file .htaccess
Options-Indexes
Perenapravlenie on other address
Replacement with the image. Method Farnera
Example the first. Headings of pages
Replace cautiously
Method of overlapping by a background (Cover-up Method)
WAP (Wireless Application Protocol)
Reduction of time of loading of webs - pages with help CSS
Mnogozadachnost` in JavaMe at HTTP connection
Interaction of streams.
Nine advice for job with Web 2.0
Beginning php to the programmer or how to start to earn
Substantiation of necessity of Storehouse of the data
Misses in the data
The directory by mistakes Oracle
Forms in HTML documents
Links
 

Replacement with the image. Method Farnera


This method is named in honour of Todd Farnera (Todd Fahrner) - one of people which were visited for the first time with this idea. Presence around of a line of a greeting of two tegov - div and span can surprise you. Actually, instead of them there could be any others, necessary is concrete for your problems{tasks}. But we shall use in our example these "wrapping" tegi.


The table of styles which carries out substitution, will consist of two simple style rules. First, we are used with the help of a set of properties of a background (background) place our image on a background of an element div.



div {

background-image:url ("hello_world.gif");

background-repeat:no-repeat;

height:35px;

}


Pay attention to property height. His{its} value is the valid height of our image, thus framing div is obliged to show the image completely, having borrowed{occupied} it is equally so much on height, how much it is necessary - neither more nor less. Property background-repeat in this case specifies that the background image should not repeat automatically along a vertical and a horizontal.


We need to hide only the text line initially placed in HTML a code. For what has appeared teg span - we require the second element that directly it would be possible "to adhere" invisibility to it{him}. It is easy for carrying out.



span {display:none;}


Let's unit these two small style rules with initial piece HTML of a code, and we shall receive simple result. It is so simple, what even is not clear, why the explanation of this way needed so much words?


Certainly, we shall not leave our marking so simple. And style rules to us should be complicated a little. Otherwise any of ours tegov <div> on page would contain the background image with words " Hello world! ", and everything, that we would place on page inside any tegov <span> </span>, would not be shown on the screen.


Well, let's pass to consideration of several real examples.