The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Sat Dec 15, 2012 2:58 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Tue Dec 20, 2011 7:16 pm
Posts: 2
Hi,

I tried to change everything on the .css and i am unable to change the blue background on the blue active pill.

Does anyone know how to solve this?

Thank you
Francisco


Last edited by imanickam on Sun Dec 16, 2012 3:44 am, edited 1 time in total.
Moved the topic from the forum General Questions/New to Joomla! 3.0 to the forum Default template: Protostar in Joomla! 3.0


Top
 Profile  
 
PostPosted: Sat Dec 15, 2012 4:36 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Sun Feb 19, 2006 6:47 pm
Posts: 17905
Location: Toledo, OH
Get and use Firebug for firefox... it'll make a css expert out of you in no time

Be sure to watch the videos

_________________
Don't HACK the Joomla! core. Extend and Override.
http://harpervance.com -
Live Joomla! Help available at the site M-F, 9-12 am edt 2-5pm edt.
by appointment on evenings and weekends.


Top
 Profile  
 
PostPosted: Sat Dec 15, 2012 9:33 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Tue Dec 20, 2011 7:16 pm
Posts: 2
Thank you for your reply but i use it for years already. The problem is that i dont have any background-color#08c line under the menu-pills active entry

Anyone with real solutions please?

Thank you in advance


Top
 Profile  
 
PostPosted: Sat Dec 15, 2012 11:46 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Sun Feb 19, 2006 6:47 pm
Posts: 17905
Location: Toledo, OH
Have you looked at other <a> tags?

_________________
Don't HACK the Joomla! core. Extend and Override.
http://harpervance.com -
Live Joomla! Help available at the site M-F, 9-12 am edt 2-5pm edt.
by appointment on evenings and weekends.


Top
 Profile  
 
PostPosted: Sun Dec 16, 2012 5:00 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Oct 15, 2012 12:01 am
Posts: 29
Have a look at this block in /templates/protostar/index.php from line 102 to 123:

Code:
<style type="text/css">
      body.site
      {
         border-top: 3px solid <?php echo $this->params->get('templateColor');?>;
         background-color: <?php echo $this->params->get('templateBackgroundColor');?>
      }
      a
      {
         color: <?php echo $this->params->get('templateColor');?>;
      }
      .navbar-inner, .nav-list > .active > a, .nav-list > .active > a:hover, .dropdown-menu li > a:hover, .dropdown-menu .active > a, .dropdown-menu .active > a:hover, .nav-pills > .active > a, .nav-pills > .active > a:hover,
      .btn-primary
      {
         background: <?php echo $this->params->get('templateColor');?>;
      }
      .navbar-inner
      {
         -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .25), inset 0 -1px 0 rgba(0, 0, 0, .1), inset 0 30px 10px rgba(0, 0, 0, .2);
         -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .25), inset 0 -1px 0 rgba(0, 0, 0, .1), inset 0 30px 10px rgba(0, 0, 0, .2);
         box-shadow: 0 1px 3px rgba(0, 0, 0, .25), inset 0 -1px 0 rgba(0, 0, 0, .1), inset 0 30px 10px rgba(0, 0, 0, .2);
      }
   </style>


.nav-pills > .active > a, .nav-pills > .active > a:hover might be what is causing you trouble.

The variables templateColor and templateBackgroundColor are defined in:

    Extensions > Template manager > My Default Style (Protostar) > Options


#08C is the default template color.

Note: to override these rules you have to be as specific as them in your css file. Let's say you have this:

HTML
Code:
<div class="green">
   <a href="#">
      Link 1
   </a>
   <span>
      <a href="#">
         Link 2
      </a>
   </span>
</div>
<div>
   <a href="#">
      Link 3
   </a>
</div>

and

CSS
Code:
.green > a { /* A link that is immediatly inside an element with the class "green" */
   color: green;
}

a { /* Any link */
   color: red;
}


Link 1 will be green, but Link 2 and Link 3 will be red. That is because a browser uses a more specific rule to render an object over a less specific one. If it finds two rules as specific, it takes the last one.

Therefore, if you don't want to modify index.php, since your changes will disappear when you update your template, be more specific in your template.css.


Top
 Profile  
 
PostPosted: Sun May 25, 2014 8:53 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Aug 23, 2005 12:20 pm
Posts: 15
MrValentin gave us a really good answer! I was not able to make my css take precedence over the definitions in the index.php file, so I edited the index.php.

In my case, I changed the variable
Code:
<?php echo $this->params->get('templateBackgroundColor');?>

to a fixed value
Code:
transparent;

and of course this worked.

I never use the original template, I always start with a renamed copy, so there is not the problem of loosing changes in an upgrade.

By the way, I don´t really got the point of protostar hard coding styles in the index.php file. it seems more difficult to edit. i would prefer all css in css´s files.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 



Who is online

Users browsing this forum: No registered users and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group