How to center the warning bar in posts?

Go down

Solved How to center the warning bar in posts?

Post by darki on September 19th 2015, 2:00 pm

Hi,

how to center only the warning bar in posts?
@Ange Tuteur You said, you know CSS like the back of your hand. So do you know this aswell? I think yes, hm? Razz

Thanks in advance!

darki
Forumember

Posts : 254
Reputation : 10
Language : German, english

http://schiggysboard.com

Back to top Go down

Solved Re: How to center the warning bar in posts?

Post by Ange Tuteur on September 19th 2015, 2:06 pm

Since we're pretty much pseudo-centering the fields, we had to make some small adjustments to the images. That is, displaying them as block-level elements and setting their left + right margins to auto.

For example :
Code:
.postprofile dd img {
  display:block;
  margin:0 auto;
}

and if we want to hide a break after those images :
Code:
.postprofile dd img + br { display:none }
avatar
Ange Tuteur
Forumaster

Male Posts : 13202
Reputation : 2918
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

Solved Re: How to center the warning bar in posts?

Post by darki on September 19th 2015, 2:12 pm

@Ange Tuteur Don't work like I want to have it. :/
It centers all images in post profile. I only want the warning bars be centered. Not possible?
https://i.servimg.com/u/f21/18/92/88/56/hfghjn10.png

The profile field calls "Verwarnungen" (in post only icon, no text), if that helps.

darki
Forumember

Posts : 254
Reputation : 10
Language : German, english

http://schiggysboard.com

Back to top Go down

Solved Re: How to center the warning bar in posts?

Post by Ange Tuteur on September 19th 2015, 2:20 pm

If you want to target a specific image you can select images with a certain src value.
Code:
.postprofile dd img[src="IMAGE"] {
  display:block;
  margin:0 auto;
}

Replace IMAGE by the URL of the image. If the field contains multiple images, just add some extra selectors like the example below.
Code:
.postprofile img[src="IMAGE"], .postprofile img[src="IMAGE"], .postprofile img[src="IMAGE"], .postprofile img[src="IMAGE"] {
  display:block;
  margin:0 auto;
}
avatar
Ange Tuteur
Forumaster

Male Posts : 13202
Reputation : 2918
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

Solved Re: How to center the warning bar in posts?

Post by darki on September 19th 2015, 2:24 pm

It works. Very Happy
What would forumotion and its users do without you? Very Happy

Problem solved.

darki
Forumember

Posts : 254
Reputation : 10
Language : German, english

http://schiggysboard.com

Back to top Go down

Solved Re: How to center the warning bar in posts?

Post by Ange Tuteur on September 19th 2015, 2:30 pm

You're welcome Mr. Green

Topic archived

Have a nice weekend. Smile
avatar
Ange Tuteur
Forumaster

Male Posts : 13202
Reputation : 2918
Language : EN10, FR5, JA5
Location : Macungie, PA

https://github.com/SethClydesdale

Back to top Go down

Back to top


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