lunes, abril 16, 2007
http://forum.joomla.org/index.php/topic,88778.0.html
A trick to get your CSS to display the same no matter what the browser!
Alot of people wonder why in some browsers, their site looks differnet. This is because each browser is made differently and each take their own approach to how CSS should be displayed in their browser. Alot of people on the Joomla! forums post how can i fix my CSS, so Ive created this post to answer their questions
$nav = ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? strtolower( $_SERVER['HTTP_USER_AGENT'] ) : '';
if (stristr($nav, "msie"))
{
echo "ie-css.css";
}
else
{
echo "templatecss.css";
}
?>
The above code will check if the browser being used is Internet Explorer, if it is it will use the file 'ie-css.css', however if the users browser isn't Internet Explorer, it will use the file 'templatecss.css'.
This function can be expanded to use different browsers, as shown below.
$nav = ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? strtolower( $_SERVER['HTTP_USER_AGENT'] ) : '';
// checks if browser is Internet Explorer
if (stristr($nav, "msie"))
{
echo "ie-css.css";
}
// checks if browser is Mozilla
elseif (stristr($nav, "moz"))
{
echo "mozilla-cssfile.css";
}
// checks if browser is Netscape
elseif (stristr($nav, "ns"))
{
echo "netscape-css.css";
}
// If browser is a different one
else
{
echo "templatecss.css";
}
?>
I hope this came in help. An example of this script in a real site would be
echo '';
?>
>
The only problem with this script is that i can take alot of coding if you want to write, an individual CSS File for each browser, however you could just load a CSS file first then get this script to over-write the default CSS to just change certain values.
Anyway i hope this helped.
Jon
This can normally be fixed using the @import function, but if this can not be used, try tying out this.
A trick to get your CSS to display the same no matter what the browser!
Alot of people wonder why in some browsers, their site looks differnet. This is because each browser is made differently and each take their own approach to how CSS should be displayed in their browser. Alot of people on the Joomla! forums post how can i fix my CSS, so Ive created this post to answer their questions
$nav = ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? strtolower( $_SERVER['HTTP_USER_AGENT'] ) : '';
if (stristr($nav, "msie"))
{
echo "ie-css.css";
}
else
{
echo "templatecss.css";
}
?>
The above code will check if the browser being used is Internet Explorer, if it is it will use the file 'ie-css.css', however if the users browser isn't Internet Explorer, it will use the file 'templatecss.css'.
This function can be expanded to use different browsers, as shown below.
$nav = ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? strtolower( $_SERVER['HTTP_USER_AGENT'] ) : '';
// checks if browser is Internet Explorer
if (stristr($nav, "msie"))
{
echo "ie-css.css";
}
// checks if browser is Mozilla
elseif (stristr($nav, "moz"))
{
echo "mozilla-cssfile.css";
}
// checks if browser is Netscape
elseif (stristr($nav, "ns"))
{
echo "netscape-css.css";
}
// If browser is a different one
else
{
echo "templatecss.css";
}
?>
I hope this came in help. An example of this script in a real site would be
echo '';
?>
>
The only problem with this script is that i can take alot of coding if you want to write, an individual CSS File for each browser, however you could just load a CSS file first then get this script to over-write the default CSS to just change certain values.
Anyway i hope this helped.
Jon
This can normally be fixed using the @import function, but if this can not be used, try tying out this.
Etiquetas: css navegador
http://forum.joomla.org/index.php/topic,25306.0.html
RESOURCES: Free Templates
A few places to get FREE/open source templates.
JoomlaHacks.com (143) Easy to browse - Full preview
http://www.joomlahacks.com/joomla/templates/0,0,0,0,9,0,8/
JoomlaOS.de (471) Gallery format - very easy to browse - Full preview
http://www.joomlaos.de/set_albumName,album03/option,com_gallery/Itemid,37/include,view_album.php.html
JoomlaTurkiye.org (110) easy to browse 15 images per page - full preview
http://joomlaturkiye.org/component/option,com_zoom/Itemid,55/catid,1/
Joomla-templates.com (14) - full preview
http://www.joomla-templates.com/index.php?option=com_content&task=category§ionid=4&id=13&Itemid=27
JoomlArt ( 8 )
http://www.joomlart.com/component/option,com_remository/Itemid,262/func,select/id,2/
dezinedepot.com (13)
http://www.dezinedepot.com/component/option,com_remository/Itemid,37/func,select/id,1/
JoomlaDesigns (3)
http://www.joomladesigns.co.uk/option,com_remository/Itemid,28/func,select/id,10/
MamboHut (608) Mostly Mambo 4.5.1+ templates
http://www.mambohut.com/templates_gallery/
JoomlaStyle (2)
http://www.joomlastyle.com/
MamboSolutions (30)
http://showcase.mambosolutions.com/free/
Joomlactive.com (10)
http://www.joomlactive.com/component/option,com_remository/Itemid,7/func,select/id,1/
JoomlaResource.com (168)
http://www.joomlaresource.com/joomla_downloads/Download/Joomla_Templates/
JoomlaFrance (9)
http://www.joomlafrance.org/telecharger/select/Templates_Administrateur_Joomla_1.x/par_titre/1.html
CMSDesign.it (3)
http://www.cmsdesign.it/index.php?categoryid=7&s=&
JoomlaShack.com ( 8 )
http://www.joomlashack.com/joomla/free-joomla-templates.html
Concept Design.nl (9)
http://conceptweb.jabstar.nl/eng/index.php?option=com_content&task=view&id=27&Itemid=70
Rocket Theme (2)
http://www.rockettheme.com/Free-Joomla-Templates/
List of resources gathered and provided thru the efforts of kenmcd.
RESOURCES: Free Templates
A few places to get FREE/open source templates.
JoomlaHacks.com (143) Easy to browse - Full preview
http://www.joomlahacks.com/joomla/templates/0,0,0,0,9,0,8/
JoomlaOS.de (471) Gallery format - very easy to browse - Full preview
http://www.joomlaos.de/set_albumName,album03/option,com_gallery/Itemid,37/include,view_album.php.html
JoomlaTurkiye.org (110) easy to browse 15 images per page - full preview
http://joomlaturkiye.org/component/option,com_zoom/Itemid,55/catid,1/
Joomla-templates.com (14) - full preview
http://www.joomla-templates.com/index.php?option=com_content&task=category§ionid=4&id=13&Itemid=27
JoomlArt ( 8 )
http://www.joomlart.com/component/option,com_remository/Itemid,262/func,select/id,2/
dezinedepot.com (13)
http://www.dezinedepot.com/component/option,com_remository/Itemid,37/func,select/id,1/
JoomlaDesigns (3)
http://www.joomladesigns.co.uk/option,com_remository/Itemid,28/func,select/id,10/
MamboHut (608) Mostly Mambo 4.5.1+ templates
http://www.mambohut.com/templates_gallery/
JoomlaStyle (2)
http://www.joomlastyle.com/
MamboSolutions (30)
http://showcase.mambosolutions.com/free/
Joomlactive.com (10)
http://www.joomlactive.com/component/option,com_remository/Itemid,7/func,select/id,1/
JoomlaResource.com (168)
http://www.joomlaresource.com/joomla_downloads/Download/Joomla_Templates/
JoomlaFrance (9)
http://www.joomlafrance.org/telecharger/select/Templates_Administrateur_Joomla_1.x/par_titre/1.html
CMSDesign.it (3)
http://www.cmsdesign.it/index.php?categoryid=7&s=&
JoomlaShack.com ( 8 )
http://www.joomlashack.com/joomla/free-joomla-templates.html
Concept Design.nl (9)
http://conceptweb.jabstar.nl/eng/index.php?option=com_content&task=view&id=27&Itemid=70
Rocket Theme (2)
http://www.rockettheme.com/Free-Joomla-Templates/
List of resources gathered and provided thru the efforts of kenmcd.
Etiquetas: plantillas joomla