The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

how to make css affect only the index page and not the other pages

View previous topic View next topic Go down

Solved how to make css affect only the index page and not the other pages

Post by longstormicus on August 23rd 2015, 9:28 pm

Technical Details


Forum version : #phpBB3
Position : Founder
Concerned browser(s) : Mozilla Firefox, Google Chrome, Safari
Who the problem concerns : All members
When the problem appeared : Right after I added the code.
Forum link : http://outcastwarriors.forum-motion.com/forum

Description of problem

Hello!

I have been searching for a way to make the categories of the index page of my forum line up next to one another. Finally, I came across this code here:
Code:
.forabg {
  display:inline-block;
  vertical-align:top;
  margin:2px;
  width:45%;
}

I added it to my forum CSS to check it out. It works, but too well. It also affects all of the other forums, which I do not want.

I was hoping someone will be able to tell me what it is I must to to make this code (or another code) only affect the main page of my forum - or how to have it only affect specific categories, not all of them.

Thank you very much for reading!


Last edited by longstormicus on August 24th 2015, 8:22 pm; edited 1 time in total

longstormicus
New Member

Posts : 8
Reputation : 1
Language : English

http://outcastwarriors.forum-motion.com/forum

Back to top Go down

Solved Re: how to make css affect only the index page and not the other pages

Post by Ange Tuteur on August 24th 2015, 10:24 am

Hi @longstormicus,

.forabg is a global class which affects all category containers. If you want to get specific you'll need to edit some templates to add your own unique class or id.

Go to Admin Panel > Display > Templates > General > index_body

Find this variable :
Code:
{BOARD_INDEX}

and wrap the following tags around it.
Code:
<div id="index-forum">{BOARD_INDEX}</div>

Save and publish.

Then you can reference #index-forum as the parent so it only affects the index categories.
Code:
#index-forum .forabg {
  background:#F00;
}

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: how to make css affect only the index page and not the other pages

Post by longstormicus on August 24th 2015, 8:22 pm

Gee, thanks @Ange Tuteur! It works perfectly!

I will mark my topic as 'solved.'

longstormicus
New Member

Posts : 8
Reputation : 1
Language : English

http://outcastwarriors.forum-motion.com/forum

Back to top Go down

Solved Re: how to make css affect only the index page and not the other pages

Post by SLGray on August 24th 2015, 8:30 pm

Topic solved and archived


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35622
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum