Friday, March 4, 2016

align items center horizontally and vertically using css




In this tutorial i am going to use three css properties to align the text or image center, most of the designers who don't know they often use margin-top, line-height etc. But thats not the perfect solution so just take few minutes to apply this in your designs its really helpful.


Step - 1 : CSS

html,body{
  height: 100%
}

.container{
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

Step - 2 : HTML

<div class="container">
    <h4>This is a sample text</h4>
</div>


Finished.


12 comments:

  1. This is an awesome post. Really very informative and creative contents. This concept is a good way to enhance knowledge. I like it and help me to development very well. Thank you for this brief explanation and very nice information. Well, got good knowledge.
    WordPress website development Chennai

    ReplyDelete
  2. Once in a while I invest more energy advancing myself than I do really accomplishing the work itself.Webdesign

    ReplyDelete
  3. Just wanna comment that you have a very nice site, I the style and design it actually stands out. new york web design company

    ReplyDelete
  4. The electronic cigarette makes use of a battery and a small heating aspect the vaporize the e-liquid. This vapor can then be inhaled and exhaled website designers nyc

    ReplyDelete
  5. you might have a fantastic weblog here! would you wish to make some invite posts on my weblog? new york website design company

    ReplyDelete
  6. Cheap Kasper Suits… [...]listed below are a couple of urls to internet websites we connect to for the fact we feel they really are really worth browsing[...]… new york web designs

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. Thanks for your insight for the great posting. I am glad I have taken the time to see this. san francisco brand agency

    ReplyDelete
  9. Many thanks for the great posting. I am glad I have taken the time to see this. branding firms san francisco

    ReplyDelete
  10. I was reading through some of your content on this internet site and I believe this site is really instructive! Keep putting up. ux agency san francisco

    ReplyDelete
  11. Well, initially, it meant a lot of spam from affiliate marketers who would have presently been violating terms of use.smm panel

    ReplyDelete

Copyright © www.sureshsharma.info All rights reserved