function goBack() { if (document.referrer == ‘https://alesh.com/’) { window.history.back(); } else { window.location.href = ‘https://alesh.com/’ } } I wanted to create a button with a “close” icon for my website that would make the feeling of going back to the home page feel light and easy. The homepage is fairly long, so I also wanted […]
Tag Archives: css
Simplest flexbox example
.container { display: flex; justify-content: space-around; } Nicely spaces whatever elements are inside it. Other useful values for justify-content are center, space-between, and space-evenly. Complete details on flexbox here.