I'm using the property overflow: hidden;
to mask the child element. However, it leaves a white space like this:
Here's the code:
<!-- Templates/Test.html -->
<html>
<style>
body{
background: #222;
}
*{
margin: 0;
padding: 0;
}
a{
text-decoration: none;
color: #000;
}
#nav-container{
position: fixed;
right: 0;
width: 550px;
}
#sublink-container{
padding: 0 50px;
border-radius: 0.5em;
background: #fff;
float: right;
margin: 30px 5px 0 0;
position: relative;
font-size: 30px;
overflow: hidden;
font-family: sans-serif;
font-weight: 300;
}
#sublink-container span{
content: '';
width: 22px;
height: 100%;
position: absolute;
top: 0;
right: 0;
background: red;
}
#sublink-container div ul{
text-align: right;
list-style-type: none;
}
#sublink-container li{
margin: 15px 0;
}
</style>
<body>
<div id="nav-container">
<div id="sublink-container">
<div>
<ul>
<a><li>Lorem Ipsum -</li></a>
<a><li>Lorem Ipsum -</li></a>
<a><li>Lorem Ipsum -</li></a>
</ul>
</div>
<span></span>
</div>
</div>
</body>
<script>
</script>
</html>
What's the solution to this?