How to center the button in shopping cart?

  • Posts: 111
  • Thank you received: 0
  • Hikashop Essential
7 years 5 months ago #270913

-- url of the page with the problem -- : www.portal-gestao.com
-- HikaShop version -- : 3.1.1
-- Joomla version -- : 3.7.2

Hello,

I'm trying to get the button on the shopping cart module in the center (see image).
However, it seems there is no div wrapping the "Finish order" button, so how can I create an override for this module and center the button?

Thanks!

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
7 years 5 months ago #270930

Hello,

Even if there is no div ; the button have a classname and you can use the "margin:0 auto" to center an element.
In the case that you really cannot find CSS to do what you want to do ; you will have to use view override.
Afterwards, I'm afraid that we do not have the required details to understand what button you're talking about so I don't know which view you're talking about exactly.
Please understand that CSS customization is outside the limits of support we can provide.

www.hikashop.com/support/documentation/1...the-display.html#css

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 111
  • Thank you received: 0
  • Hikashop Essential
7 years 5 months ago #270959

Hello,

Thanks, you may see the class I'm using for this button in the image below.
It is the class for the template so it matches the site design.


Thanks for explaining how I can center the button.
Regards

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
7 years 5 months ago #270961

Hello,

We can see in your screenshot that the link ( a ) have a class name but most important, is within a DIV with a class name and even an ID !
So you can already do all you want to do on that link.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 111
  • Thank you received: 0
  • Hikashop Essential
7 years 5 months ago #271005

Hello,
Thanks, you're right. I managed to target the a inside the div id.
The thing is: all the buttons in the site have the same style, and it with my (limited) knowledge of CSS, I can't center the button.
I tried:

#hikashop_cart_module .uk-button {
	margin-left:auto;
	margin-right:auto;
}
And:
#hikashop_cart_module .uk-button {
        position: relative;
	margin: 0 auto;
}
#hikashop_cart_module .uk-button {
       text-align: center;
}
But nothing centers the button!

PS: Why is the button not centered by default?? This would allows all to not waste our time with this..

Last edit: 7 years 5 months ago by Jerome. Reason: [code] tag is nice

Please Log in or Create an account to join the conversation.

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
7 years 5 months ago #271065

You can do like that:

#hikashop_cart_module .uk-button {
	display:block;
	margin-left:auto;
	margin-right:auto;
	width: 210px;
}
and it will be centered.

It is not centered by default because modules buttons are not centered by default.
For example, the login module of Joomla: monosnap.com/file/8hpz88NNUy18zJAL6ai7YU2Ja24FTQ
So we respect that to be consistent. It's up to the Joomla template to style the buttons differently if needed.

The following user(s) said Thank You: nunonog

Please Log in or Create an account to join the conversation.

Time to create page: 0.076 seconds
Powered by Kunena Forum