Mobile app version of vmapp.org
Login or Join
Sherry646

: How to hide html elements in mobile mode only I'm working with the following code on my squarepace Pacific template via the html code injection (the code creates a white double lined border

@Sherry646

Posted in: #HowTo #Html #WebsiteDesign

I'm working with the following code on my squarepace Pacific template via the html code injection (the code creates a white double lined border around the page):

<head>
<style>
body {
margin:0px;
background-image: url(http://static1.squarespace.com/static/56df76e4356fb0e00c7e94da/t/5703667a27d4bdaccf43195e/1459840646163/paper_box_texture+CMYK.jpg);
}
.top, .left, .right, .bottom {
display: block;
position: absolute;
width:100%;
height:180%;
}
.top {
border-top: 1em double #fff ; top: 40px; z-index:100;
}
.left {
border-left: 1em double #fff ; left: 40px; z-index:200;
}
.right {
border-right: 1em double #fff ; right: 40px; z-index:300;
}
.bottom {
border-bottom: 1em none #fff; bottom: 200px; z-index:400;
}
</style>
</head>
<body>
<div class="top"></div>
<div class="left"></div>
<div class="right"></div>
<div class="bottom"></div>
</body>
</html>


It works on the desktop mode but for mobile it cuts off the copy:



Does anyone know how to enable this border on desktop but remove it for mobile device?

Thanks!

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Sherry646

1 Comments

Sorted by latest first Latest Oldest Best

 

@Reiling762

Use CSS to not display these divs below a particular break point. (I use 400px in the example below, but you can set that to whatever you want.)
@media screen and (max-width: 25rem) { /* 400 px */

.top, .left, .right, .bottom {
display: none;
}

}

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme