css rule for frontpage only - Joomla! Forum - community, help and support
i have bit of code:
i want work on front page. not on other pages. make class , use suffix menu item. doesn't work here. how solve this?
code: select all
body#main {
margin-top: 75px;
i want work on front page. not on other pages. make class , use suffix menu item. doesn't work here. how solve this?
hi gany.
so, if want add custom styling body on frontpage/default page,
you can try doing in template index.php file. not sure if best solution, think can work you.
if not want in template file, can create plugin same.
so, if want add custom styling body on frontpage/default page,
you can try doing in template index.php file. not sure if best solution, think can work you.
code: select all
<?php
$app = jfactory::getapplication();
$menu = $app->getmenu();
if ($menu->getactive() == $menu->getdefault()) {
echo '<body class="frontpage">';
} else {
echo '<body class="not-frontpage">';
}
?>
code: select all
<style>
.frontpage{ margin-top: 75px; }
</style>
if not want in template file, can create plugin same.
Comments
Post a Comment