Seeking advice for my Web Application prototype - looking to prevent text wrapping in off-canvas menu paragraphs using CSS or JS.
New to building this type of menu, I used an example from W3Schools to achieve the current design.
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: "Lato", sans-serif;
}
.sidenav {
height: 100%;
width: 0;
position: fixed;
z-index: 1;
top: 0;
left: 0;
background-color: #ff0000;
overflow-x: hidden;
transition: 0.6s;
padding-top: 180px;
}
.sidenav a {
padding: 10px 0px 10px 35px;
text-decoration: none;
font-size: 20px;
color: #ffffff;
display: block;
transition: 0.5s;
}
.sidenav a:hover, .offcanvas a:focus{
color: #a6a6a6;
}
.sidenav .closebtn {
position: absolute;
top: 0;
right: 0px;
font-size: 35px;
margin-right: 20px;
}
#main {
transition: margin-left 0.6s;
padding: 26px;
}
@media screen and (max-height: 450px) {
.sidenav {padding-top: 15px;}
.sidenav a {font-size: 18px;}
}
</style>
</head>
<body>
<div id="mySidenav" class="sidenav">
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
<a href="#">Customers</a>
<a href="#">Pupils</a>
<a href="#">Teachers</a>
<!-- Try to separate the word ""AndroidNotices" and you'll see... -->
<a href="#">AndroidNotices</a>
</div>
<div id="main">
<h2>Off-Canvas Menu</h2>
<p>Click on button to open the side navigation menu.</p>
<span style="font-size:30px;cursor:pointer" onclick="openNav()">☰ Menu</span>
</div>
<script>
function openNav() {
document.getElementById("mySidenav").style.width = "200px";
document.getElementById("main").style.marginLeft = "200px";
}
function closeNav() {
document.getElementById("mySidenav").style.width = "0";
document.getElementById("main").style.marginLeft= "0";
}
</script>
</body>
</html>