Post by Emma0511 » Tue Mar 31, 2020 8:56 pm

Hello,

I am working on OpenCart Version 3.0.3.2 and am still on a localhost with XAMP.
My shop's logo is bigger than the search bar and I want to make it align. In ...\Webshop\catalog\view\theme\default\stylesheet\stylesheet.css I edited to:

Code: Select all

 #logo {
	margin: 0 0 10px 0;
	height: 40px;
}
However, after refreshing and clearing the cache the change never appears.
I also tried to change the twig file in ...\catalog\view\theme\default\template\common\header.twig. I found on the internet the resize filter but this filter returns unknown by opencart.

Code: Select all

        <div id="logo">{% if logo %}<a href="{{ home }}"><img src="{{ logo|resize(300, 500) }}" title="{{ name }}" alt="{{ name }}" class="img-responsive" /></a>{% else %
        }
What can I do ?
Last edited by straightlight on Tue Mar 31, 2020 9:14 pm, edited 1 time in total.
Reason: Added code tags.

Newbie

Posts

Joined
Tue Mar 31, 2020 8:47 pm

Post by scottyboyyy » Wed Apr 01, 2020 2:37 am

Could be that you edited the #logo for the mobile view rather than desktop or class-responsive may have values interfering.

You could try removing that class and see what happens.

You could just make a new id for it, call it #emmalogo and see if the changes appear.

Code: Select all

 #emmalogo {
	margin: 0 0 10px 0;
	height: 40px;
}

Code: Select all

<div id="[u]emmalogo[/u]"><a href="{{ home }}"><img src="{{ logo}}" title="{{ name }}" alt="{{ name }}" style="max-width:[u]300px[/u]; width:100%;  height:auto;"/></a></div>
or put the style inline to test it works:

Code: Select all

<div style="margin: 0 0 10px 0; height: 40px;"><a href="{{ home }}"><img src="{{ logo}}" title="{{ name }}" alt="{{ name }}" style="max-width:[u]300px[/u]; width:100%;  height:auto;"/></a></div>

Active Member

Posts

Joined
Fri Apr 07, 2017 2:36 am

Post by thekrotek » Wed Apr 01, 2020 2:57 am

First of all, don't edit default CSS file, use custom one or Custom Code section of your theme. Second, selector should be "#logo img" or "body #logo img" to override the default one.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by paulfeakins » Wed Apr 01, 2020 7:09 pm

thekrotek wrote:
Wed Apr 01, 2020 2:57 am
First of all, don't edit default CSS file, use custom one or Custom Code section of your theme. Second, selector should be "#logo img" or "body #logo img" to override the default one.
Exactly, so have a read of this:
https://www.w3schools.com/css/css_specificity.asp

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: JessiesBoutique, pprmkr and 501 guests