Page 1 of 2

Centre Image in Grid

Posted: Fri May 24, 2013 9:05 am
by Andrew Gilmour5879596

Hi,

I am trying to centre an image in a grid. See attached.

The name is icon1 in the Common Settings. I have tried the javascript that I have seen in previous posts but can't seem to make it work. I am trying to centre it horizontally and vertically. Any advice on what to do?

Thanks

Andrew
Image


Centre Image in Grid

Posted: Fri May 24, 2013 9:44 am
by Maryna Brodina

Hello! Could you post JS you tried?


Centre Image in Grid

Posted: Fri May 24, 2013 2:21 pm
by Andrew Gilmour5879596

Hi Marina,

Sorry - I can't find it again. I took it from a previous post. Something like
$.("icon1").css......align.middle.... etc etc

It didn't work though

Kind Regards

Andrew


Centre Image in Grid

Posted: Fri May 24, 2013 3:52 pm
by Kateryna Grynko

Hi Andrew,

To center components in cell you can select the cell, click "more properties" on properties panel an add property align = center.

This reference can also be helpful: https://getsatisfaction.com/apperyio/...


Centre Image in Grid

Posted: Fri May 24, 2013 8:48 pm
by Andrew Gilmour5879596

Hi Katya,

I'm struggling a bit here. I have tried both methods and still can't get the icon centred.

I have added some screen shots - is there something that I am doing wrong. I have had both methods at the same time - I have tested each individually.

Thanks

Andrew
Image Image Image


Centre Image in Grid

Posted: Fri May 24, 2013 11:38 pm
by Igor

Hi Andrew.

Please try once more the next methods:

  • Remove all css styles for this component;
  • Select the cell that contains the image;
  • Add text-align = center in "More Properties" dialog.

Centre Image in Grid

Posted: Sat May 25, 2013 10:40 am
by Andrew Gilmour5879596

Hi Igor,

Tried this - no luck. I then went back to trying to add css for the image. The css element is called pic {.....etc I then gave the image a classname of pic. I have noticed though in the HTML that the classname is class="pic mobileimage1" - is this right?

Andrew Image


Centre Image in Grid

Posted: Sat May 25, 2013 10:49 am
by Alena Prykhodko

Hi, Andrew!

Try to add CSS with the following code:
code.ClassName{
text-align: center;
}/code
where the ClassName - the class name of Grid component, remove class name of the Image component


Centre Image in Grid

Posted: Sat May 25, 2013 11:55 am
by Andrew Gilmour5879596

Still no joy. Can I share this project with you so you can take a look?

Andrew


Centre Image in Grid

Posted: Sat May 25, 2013 11:58 am
by Alena Prykhodko

Yes, Andrew. Share it with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a and tell please name of the project.