Advertisement
asadsuman

CSS-Tips-Trick-Part-2

Jan 25th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. <!--CSS Tips & Tricks Part-2 Position Element(Center) Clear and Floats --->
  2. 1. Center Position:
  3. 1.1 Text Position(text-align{center})
  4. 1.2 Text position with a block{width:your width;margin:0 auto;}
  5. 1.3 Image Position {display:block;margin:0 auto;}
  6. 1.4 Position Using Height {height:150px;display:table-cell;verticle-align:middle;}
  7.  
  8. 2. Center Position
  9. 2.1 Using Background--{background:#ccc url(asad.jpg) center center no-repeat;width:100%;
  10. min-height:30em;}
  11.  
  12. 2.2 Using relative and absolute -- Before div{position:relative;
  13. min-height:30em;
  14. width:100%;} and div class with image {position:absolute;
  15. top:50%;
  16. left:50%;
  17. margin:-234px 0 0 -234px;}
  18.  
  19. 3. Clear and Floats Issue
  20. 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
  21. .group:before,
  22. .group:after{
  23. content:"";
  24. display:table;
  25. }
  26. .group:after{
  27. clear:both;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement