Andrew Gilmour5879596
Posts: 0
Joined: Wed May 22, 2013 1:22 pm

Centre Image in Grid

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Centre Image in Grid

Hello! Could you post JS you tried?

Andrew Gilmour5879596
Posts: 0
Joined: Wed May 22, 2013 1:22 pm

Centre Image in Grid

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

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Centre Image in Grid

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/...

Andrew Gilmour5879596
Posts: 0
Joined: Wed May 22, 2013 1:22 pm

Centre Image in Grid

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

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Centre Image in Grid

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.
Andrew Gilmour5879596
Posts: 0
Joined: Wed May 22, 2013 1:22 pm

Centre Image in Grid

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

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Centre Image in Grid

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

Andrew Gilmour5879596
Posts: 0
Joined: Wed May 22, 2013 1:22 pm

Centre Image in Grid

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

Andrew

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Centre Image in Grid

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

Return to “Issues”