News:

Wondering if this will always be free?  See why free is better.

Main Menu

CSS id doesn't work

Started by Sir Osis of Liver, September 21, 2017, 12:37:30 AM

Previous topic - Next topic

Sir Osis of Liver

I've added this id to format page index in Display.template.php -



#pageindex
{
color: #FFF;
background-color: rgba(0, 0, 0, 0.3);
border-radius: 5px;
padding: 0 3px 0 3px;
}



If I do this in the template, it has no effect -



<div id="pageindex" class="margintop middletext floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#lastPost"><strong>' . $txt['go_down'] . '</strong></a>' : '', '</div>



If I put same formatting inline, it works -



<div style="color: #FFF; background-color: rgba(0, 0, 0, 0.3); border-radius: 5px; padding: 0 3px 0 3px;" class="margintop middletext floatleft">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' &nbsp;&nbsp;<a href="#lastPost"><strong>' . $txt['go_down'] . '</strong></a>' : '', '</div>



What am I missing? :-\

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Arantor

Is there other styling on the same id later in the file?

Gwenwyfar

Use the inspector to check for any other styles overriding the one you added (or if they are getting through at all)
"It is impossible to communicate with one that does not wish to communicate"

Sir Osis of Liver

Quote from: Arantor on September 21, 2017, 02:08:09 AM
Is there other styling on the same id later in the file?

It's a unique id, doesn't appear anywhere else in index.css or Display.template.php.

Quote from: Gwenwyfar on September 21, 2017, 07:36:30 AM
Use the inspector to check for any other styles overriding the one you added (or if they are getting through at all)



Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Gwenwyfar

I mean the css side of the inspector, with the #pageindex div selected :)
"It is impossible to communicate with one that does not wish to communicate"

Sir Osis of Liver

It's not showing me #pageindex.  I'm also not seeing similar styling I added to linktree, which is working.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Arantor

If you actually click on the element itself, it should show you what styles it thinks are currently applicable to that element, i.e. what styles currently apply to #pageindex. Try that.

Sir Osis of Liver

It just shows the three classes, and some inherited styles, none of which look like they'd interfere with #pageindex. 
Just dawned on me you can look for yourself here.  It's supposed to style the page index with shaded bg, similar to the linktree.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Arantor

It's inside an unterminated comment. Needs a */ on the previous line.

Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Advertisement: