Sometimes I need to use a simple section with numbers instead of a title of some text. I found a section style very interesting from a blog. Based on html inspection, I create css codes for this type of numeric section. I use this style in this blog.
Here are what I did.
01
First, I use an image as background, a horizontal radiation or shadow line, named as css class
numericSection
02
This the outer circle, named as css class
numericSectionOuterCicle
:The inner circle, named as css class
numericSectionInnerCircle
, is smaller than the outer circle above:
03
My numeric section is a combination of above image and css classes.
- /* Numeric Section Style */
- div .numericSection {
- margin: 1.5em auto;
- padding-top: 0.5em;
- padding-bottom: 0.5em;
- white-space: normal;
- border: none;
- text-align: center;
- width: 100%;
- background-image: url(http://2.bp.blogspot.com/.../section.png);
- background-size: 100%;
- background-position: 50% 50%;
- background-repeat: no-repeat no-repeat;
- }
- div .numericSectionOuterCicle {
- width: 60px;
- min-height: 60px;
- border-radius: 50%;
- background: lightgray;
- display: inline-block;
- }
- div .numericSectionInnerCicle {
- width: 50px;
- min-height: 50px;
- margin: 5px auto;
- background-color: gray;
- color: white;
- font-size: 150%;
- line-height: 50px;
- border-radius: 50%;
- }
The above css styles are added to my blogger html template. Here is an example of html for numeric section 01:
- <div class="numericSection">
- <div class="numericSectionOuterCicle">
- <div class="numericSectionInnerCircle">
- 01
- </div>
- </div>
- </div>
0 comments:
Post a Comment