Implementing multi languages with CSS and PHP -
I am creating a small site, which needs to support 2 languages for the same page.
Each language has different buttons on the page, buttons are basically some pictures inside the text. Using a CSS file for each language, the status of the button is completed. The question is what works for me to change the button for each image. I can put a statement if php can be used, and some other src if lang == English or something else can apply it with lang == Russian, or CSS file (I do this with a div Can it set up the background in the CSS)?
What would you recommend?
Cheers.
you can
This will basically work like this: for example
& Lt; Button ID = "button_ok" & gt; OK & lt; / Button & gt;
And define different background images in your English / Russian css files:
(english.css)
#button_ok {Background-child: urls (images / buttons / ing / ok. Gif); }
and (russian.css)
#button_ok {background-image: url (images / buttons / rus / ok.gif); }
All other elements that have been selected when not changed in the third file do not change:
p {font-size : 1em; The last step is to select at the top of each page that you want to load: if ($ _GET) ['Lang'] == 'England') $ cssFile = 'english.css'; Otherwise ($ _GET ['lang'] == 'ras') $ cssFile = 'russian.css';
And include a special and generic CSS file in your head:
& lt; Link rel = "stylesheet" type = "text / css" href = "normal css" /> & Lt; Link rel = "stylesheet" type = "text / css" href = "& lt ;? php echo $ cssFile ;? & gt;" / & Gt;
Comments
Post a Comment