Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--CSS Tips & Tricks Part-2 Position Element(Center) Clear and Floats --->
- 1. Center Position:
- 1.1 Text Position(text-align{center})
- 1.2 Text position with a block{width:your width;margin:0 auto;}
- 1.3 Image Position {display:block;margin:0 auto;}
- 1.4 Position Using Height {height:150px;display:table-cell;verticle-align:middle;}
- 2. Center Position
- 2.1 Using Background--{background:#ccc url(asad.jpg) center center no-repeat;width:100%;
- min-height:30em;}
- 2.2 Using relative and absolute -- Before div{position:relative;
- min-height:30em;
- width:100%;} and div class with image {position:absolute;
- top:50%;
- left:50%;
- margin:-234px 0 0 -234px;}
- 3. Clear and Floats Issue
- In every section class add the ground class in your css or you can give any name of the class and past below css in the class
- .group:before,
- .group:after{
- content:"";
- display:table;
- }
- .group:after{
- clear:both;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement