Opencart modules full-width with CSS

We saw some posts in Stackoverflow and Opencart forum to make the slideshow module full-width, similarly, the HTML content module full-width and similar posts asking help. Thus, we are showing you a simple way to make full-width with CSS for Opencart.

Make Slideshow full-width

The CSS used is similar to below which calculates the left position and starts from it making it 100% vertical width.

<style>
  .slideshow{
  	left: calc(-1 * (100vw - 100%) / 2);
        width: 100vw;
  	position: relative;
  	padding: 50px 20px;
  }
</style>

Now let’s start with the slideshow module. As we need to add the above code, so the easy we add it is on the Google Analytics module section. For that, go to admin >> Extensions >> Extensions >> Choose the extension type >> Analytics >> Install the Google Analytics >> Edit it >> Paste the above code in the Google Analytics Code field >> Enabled it >> Then, click the save button.

With this simple CSS code, the slideshow of the Opencart core becomes full-width.

See our free module: OpenCart free extension – full-width position in the layout of v 3.0.2.0

Make HTML content module full width

A simple way is to add the title, content, and CSS all in the HTML description like below:

<div class="htmlcontentfullwidth">
	<h2>This is heading title of HTML module</h2>
	<p>
        HTML Module description HTML Module description HTML Module description HTML Module description HTML Module description HTML Module description HTML Module description HTML Module description HTML Module description HTML Module description HTML Module description HTML Module description HTML Module description HTML Module description HTML Module description HTML Module description
    </p>
</div>
<style>
  .htmlcontentfullwidth{
      left: calc(-1 * (100vw - 100%) / 2);
      width: 100vw;
      position: relative;
      padding: 50px 20px;
  }
</style>

An HTML content module doesn’t have any class or id by default so we implemented it like above. With that the HTML module becomes full width like below:

In this way, you can make a full-width module with a simple CSS in the Opencart version. Let us know if you have any other better ideas and need support to make any modules full-width. Please subscribe to our YouTube Channel for Opencart video tutorials and get lots of other Opencart free modules. You can also find us on Twitter and Facebook.

LEAVE A REPLY

Please enter your comment!
Please enter your name here