A simple way to make beveled lists.
Check compatibility for those old, crumby browsers.
html and css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ul.beveled { | |
background-color: #efefef; /* any color darker than white */ | |
list-style-type: none; | |
margin: 0; | |
} | |
ul.beveled li:not(:first-of-type) { | |
border-top: 1px solid rgba(255,255,255, 0.2; | |
} | |
ul.beveled li:not(:last-of-type) { | |
border-bottom: 1px solid rgba(0,0,0, .2); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul class="beveled"> | |
<li>List item | |
<li>List item | |
<li>List item | |
<li>List item | |
</ul> |
haml and sass
Let’s pretty that up with haml and sass (examples of both the scss and indented-sass syntax.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ul.beveled | |
- 4.times do | |
li List item |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ul.beveled | |
background-color: #efefef | |
list-style-type: none | |
margin: 0 | |
padding: 10px | |
@include box-shadow( 0 2px 3px 0 rgba(0,0,0, .3) | |
li | |
padding: 10px 5px; | |
&:not(:first-of-type) | |
border-top: 1px solid rgba(255,255,255, 0.2) | |
&:not(:last-of-type) | |
border-bottom: 1px solid rgba(0,0,0, .2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ul.beveled { | |
background-color: #efefef; | |
list-style-type: none; | |
margin: 0; | |
padding: 10px; | |
@include box-shadow( 0 2px 3px 0 rgba(0,0,0, .3); | |
li { | |
padding: 10px 5px; | |
&:not(:first-of-type) { border-top: 1px solid rgba(255,255,255, 0.2); } | |
&:not(:last-of-type) { border-bottom: 1px solid rgba(0,0,0, .2); } | |
} // li | |
} // ul.beveled |