html - How to fade color and set margin-left for the title's box with CSS -


what i've done here make box image below how fade color , set margin-left= 10px; margin-top: 5px title's box css

pic


demo

html:

<div id="_div">     <span class="_top">company performance</span>     <span class="_content">electric consumption: 2300kw</span> <div> 

css:

#_div {     display: block;     -webkit-border-radius: 7px;     -moz-border-radius: 7px;     border-radius: 7px;     width: 300px;     height: 100px;     background-color: #ffffff;     box-shadow: 5px 5px 5px #e0e6e8;     border: 1px solid #c1dee0; } ._top {     display: block;     background-color: #d0e3ec;     -webkit-border-top-left-radius: 7px;     -webkit-border-top-right-radius: 7px;     -moz-border-radius-topleft: 7px;     -moz-border-radius-topright: 7px;     border-top-left-radius: 7px;     border-top-right-radius: 7px;     padding-bottom: 10px;     border-bottom: 1px solid #c1dee0; } ._content {     display: block;     margin-left: 10px;     margin-top: 10px; } 

not clear why want use margin if want align text use padding _top class

remove padding _top class , add

padding: 5px 0 5px 10px; 

to fade color use opacity: .5


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -