# How to create  a close button for a page

**URL:** <https://forum.wixstudio.com/t/how-to-create-a-close-button-for-a-page/29367>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [February 22, 2018, 9:47am UTC](https://forum.wixstudio.com/t/how-to-create-a-close-button-for-a-page/29367 "2018-02-22T09:47:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rishabh-jain](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/rishabh-jain/32/8110_2.png) [@rishabh-jain](https://forum.wixstudio.com/u/rishabh-jain)\
**Post date:** [February 22, 2018, 9:47am UTC](https://forum.wixstudio.com/t/how-to-create-a-close-button-for-a-page/29367/1 "2018-02-22T09:47:16Z")

</div>

I want to create a close button that will close the page like light box close button…

---

<div class="post-metadata">

**Author:** ![yisrael-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/yisrael-wix/32/1107_2.png) [@yisrael-wix](https://forum.wixstudio.com/u/yisrael-wix)\
**Post date:** [February 22, 2018, 9:50am UTC](https://forum.wixstudio.com/t/how-to-create-a-close-button-for-a-page/29367/2 "2018-02-22T09:50:25Z")

</div>

Hi Rishabh,

A page doesn’t really close. You can go “back” or go to another page, but a page doesn’t really close. You could “simulate” a page close by just going back to the previous page.

Yisrael

---

<div class="post-metadata">

**Author:** ![rishabh-jain](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/rishabh-jain/32/8110_2.png) [@rishabh-jain](https://forum.wixstudio.com/u/rishabh-jain)\
**Post date:** [February 22, 2018, 10:00am UTC](https://forum.wixstudio.com/t/how-to-create-a-close-button-for-a-page/29367/3 "2018-02-22T10:00:04Z")

</div>

Hi Yisrael,  
Do you know how to create back button which allows user to navigate to a previously viewed page because there is no back button on wix we have add a button and link it.

---

<div class="post-metadata">

**Author:** ![yisrael-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/yisrael-wix/32/1107_2.png) [@yisrael-wix](https://forum.wixstudio.com/u/yisrael-wix)\
**Post date:** [February 22, 2018, 10:20am UTC](https://forum.wixstudio.com/t/how-to-create-a-close-button-for-a-page/29367/4 "2018-02-22T10:20:01Z")

</div>

You can use [wix-window.referrer](https://www.wix.com/code/reference/wix-window.html#referrer) to get the page from where you came, and [wix-location.to()](https://www.wix.com/code/reference/wix-location.html#to) to go back (limit to a local page so you don’t go to some external site).

---

<div class="post-metadata">

**Author:** ![loraportnoy](https://avatars.discourse-cdn.com/v4/letter/l/3ec8ea/32.png) [@loraportnoy](https://forum.wixstudio.com/u/loraportnoy)\
**Post date:** [July 21, 2020, 8:31pm UTC](https://forum.wixstudio.com/t/how-to-create-a-close-button-for-a-page/29367/5 "2020-07-21T20:31:21Z")

</div>

Yisrael, unfortunately, navigating to another page does not close the current instance tab in web browser. Please assist. Thanks

---

<div class="post-metadata">

**Author:** ![mims](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/mims/32/80662_2.png) [@mims](https://forum.wixstudio.com/u/mims)\
**Post date:** [August 13, 2021, 3:56pm UTC](https://forum.wixstudio.com/t/how-to-create-a-close-button-for-a-page/29367/6 "2021-08-13T15:56:10Z")

</div>

hi. we really need a ‘close’ or ‘leave this site’ button enabled for our client. This is crucial for sites that have sensitive content such as domestic violence support sites. An example of this is [https://safelives.org.uk/](https://safelives.org.uk/) . How can we achieve this in Velo please?

---

<div class="post-metadata">

**Author:** ![yisrael-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/yisrael-wix/32/1107_2.png) [@yisrael-wix](https://forum.wixstudio.com/u/yisrael-wix)\
**Post date:** [August 15, 2021, 8:56am UTC](https://forum.wixstudio.com/t/how-to-create-a-close-button-for-a-page/29367/7 "2021-08-15T08:56:52Z")

</div>

Please observe the [community guidelines](https://www.wix.com/corvid/forum/community-discussion/forum-policies-and-guidelines) and refrain from multiple posts on the same topic or question.

I posted the [answer](https://www.wix.com/velo/forum/main/comment/6118f4fa499cf90015935efb) in your original post.
