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 center the warning bar in posts?

View previous topic View next topic 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 }

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

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://i21.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;
}

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

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

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.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