Topic on Project:Support desk

substitution alignment

13
Dog1994 (talkcontribs)

I substitute my infoboxes because that's easier for me.

I can't for the life of me figure out how to change the alignment without basically creating an entirely new infobox to call upon, which would be super annoying.

I've tried adding |align        ="left" and |style =leftto the infobox afterward and nothing changes. What can I do? i also do not want to edit common.css

Ciencia Al Poder (talkcontribs)
Dog1994 (talkcontribs)

they're not copied, no. completely built from scratch.

I have a CSS override so that they all align=right but I want some of them to align=left, and that's my problem.

AhmadF.Cheema (talkcontribs)

If you are using local CSS overrides, than I assume those CSS rules are implemented on-to the Infobox through a class. In which case, can't just two separate classes be made, one for left-alignment and the other for right-alignment?

Dog1994 (talkcontribs)

They can, how would I accomplish that?

To make it clear: i have one page that I am attempting to use multiple infoboxes on and it looks awful with all of them on the same alignment. I want to change it so that every other box is aligned left.

AhmadF.Cheema (talkcontribs)

How exactly are you accomplishing, as you mentioned above, "align=right" for your Infoboxes?

Dog1994 (talkcontribs)

I add:

.infobox { float: right; }

to Common.css and that forces all infoboxes to the right, which I need otherwise I can't place them where I need them to be. This is great for the vast majority of pages where I want a right-aligned infobox, but in some pages I need left aligned. I can't just remove the common.css since that will force all of my infoboxes back to the left.

So now I'm stuck since I need to be able to fluctuate certain infoboxes to the left.

Ciencia Al Poder (talkcontribs)

On the table or div of the infobox, add style="float:{{{align|right}}};"

then add align=left on the templates you want it to be left-aligned. You can remove the .infobox { float: right; } style

110.149.125.240 (talkcontribs)

Or add .infobox-float-left { float: left; } as a class, and add that class to the infoboxes you want on the left.

You should also add clear: right; to your infobox class, so your infoboxes stay to the right of the page, rather than stacking up next to each other.

Dog1994 (talkcontribs)

i can't tell if i just have no idea what i'm doing or maybe i've set up templates completely wrong.

I tried following @Ciencia Al Poder's suggestion but as usual, I still can't get my templates to do anything but be EITHER stuck permanently on the left or permanently on the right.

To my Template:Character page (the one I use most often) I added:

| style="float:{{{align|right}}} but removed the ; escape since that didn't make sense to me (but I later added it back and it made no difference)

and then I removed the

.infobox { float: right; }

from my MediaWiki:Common.css

but without that, my templates simply do not obey any float or align properties.

I didn't follow the other suggestion since i dont want tom mess with classes that I don't understand

Ciencia Al Poder (talkcontribs)

Be sure style="float:{{{align|right}}}" is on the table, not on a column

Dog1994 (talkcontribs)

How do I ensure it's on a table versus a column?

Currently I substitute, so I'm not sure it's being displayed as a table. I'm still very inexperienced with infoboxes, sorry!

Ciencia Al Poder (talkcontribs)

See Help:Tables to see what's a table, and what's a column (or more correct, a table cell, which is what I wanted to say)

Reply to "substitution alignment"