Guys I am developing a small php based website and wish to set "Arial" font for all php files/site. Right now I have to set this in all tables individually. Please help me how I can set font style at one place so if I change style from there it change in all files? GCS
If you haven't explicitly defined font's for various elements, setting font for body should do the trick. body { font-family: Arial; }
hmm.. if you have designed too many tables and used inline font styles, you could try replacing them and then applying the css tricks.. or use javascript ( jquery ) to find all tags with table and set the font style to Arial. I think the document is loaded, styles applied and then javascript on load is run. so at first the fonts may show up as the original one you have set but later on they will just show as Arial.. Let us know how you got through. Cheers
paste these lines in your CSS file.. body {font-family:Arial;} table {font-family:Arial;} table tr {font-family:Arial;} table tr td{font-family:Arial;} your all page set in arial font.. thanks
you may want backup fonts like AlexKey posted.if the user doesn't have arial it goes to the second one or third and so on.
you must link the style sheet file with every php files instead of putting css in head of every file. Or else if you're creating dynamic sites then you need to link to the header file of PHP.
Yeah, this is not the way to get a site-wide format change - that's what CSS is for! In fact, NO formatting should be done in PHP if at all possible. We want programming and web design kept well away from each other! Even if other pages have differing styles, there should still be a base CSS stylesheet which defines all those default values and is specified for each page - that bit COULD be done in PHP, though no need. You just include <link rel="stylesheet" type="text/css" href="defaultstylesheet.css" /> HTML: ...or whatever the file is called, in your HTML header, and put all your default settings in there as above.
Hi buddy Additionally I added the following to set standard font size of all module and it worked. body {font-size:12;} table {font-size:12;} table tr {font-size:12;} table tr td{font-size:12;} GCS