I have the following code for my menu:
HTML:
<div class="container wrapper">
<nav>
<ul class="menu">
<li><a href="#">Home</a></li>
<li><a href="#">page1</a></li>
<li><a href="#">page2</a></li>
</ul>
</nav>
And the CSS:
.wrapper{
padding:20px;
background:#d3d3d3;
height:200px;
}
.menu{
background:#7F7979;
}
.menu li{
padding-top: 20px;
padding-bottom: 20px;
padding-left: 15px;
display: inline-block;
}
.menu li a{
color:white;
}
nav ul{
list-style:none;
margin:0
padding:0;
}
What I want to achieve is at the right and left corners to look like it comes from behind the container (like a 3D effect if we can call it this way). Haven't tried anything since I don't have any idea how to achieve this.
I googled a bit but didn't find any website to inspect the code. If someone knows any, please point me out.
And plus, how can I do this by ignoring the container
padding
? Is it possible to make it with my menu inside this container
which has a padding
and still forcing the margins to go outside it?
NOTE: I'm not trying to someone do this for me, I'm trying to figure out what CSS
properties should I use to achieve what I want.
To better explain what I wanted:
If it helps, my demo:
Thank you so much for pointing me the right direction.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…