Skip to product information
1 of 1
Published:2024.12.26

Example of how to implement a modal window using only CSS without using Javascript in Shopify

Example of how to implement a modal window using only CSS without using Javascript in Shopify

Applications

  • Product information management and editing

How to implement

  • HTML/CSS
  • Javascript
View full details

This is a quick and easy way to add a temporary modal window, such as for New Year's holiday announcements, using only CSS without using Javascript.

◆Benefits of implementation
・Lightweight implementation ・Highly maintainable simple code

◆Specific implementation steps ・Add a customized Liquid section where you want to display it, insert the prepared modal code, and apply styling with CSS

* Important Note: However, if the "transform" property is set on the parent element, such as product information for the "Dawn/Rise" theme, the modal display of the entire screen will not function correctly.
You need to check the parent element's style beforehand.


Example of how to implement a modal window using only CSS without using Javascript


[How to set it up] Add a customized Liquid section where you want it to appear and insert the code.


[Note] If the parent element of the code you add to display the modal has the "transform" property set, the modal will not be displayed on the entire screen (e.g., product information for the "Dawn/Rise" theme).


After making a purchase (all items are ¥0), you will be able to view the sample code.

If you have already made a purchase, please login here.

Sample Codes

Test Theme :Dawn/Rise 15.2.0

Add your customized Liquid section wherever you want it to appear and insert the code.

Related Post