Skip to content

Information Architect

About building and managing software

  • Blog
  • About me
  • Privacy Policy

Tag: css

CSS: How to preserve aspect ratio for an HTML element

The Problem: How to set aspect ratio for a HTML element In my case I needed that for a slider. But sometimes it can be required by some fancy layout or gallery component. The Solution: It’s simpler than you think! Lets assume we want to preserve 4:3 aspect ratio for slide placeholder to display an… Read more CSS: How to preserve aspect ratio for an HTML element

Posted on 7 March 201813 November 2018 by Michał Zięba

CSS: How to center content (multiple ways)

The Problem How to make content centered both vertically and horizontally. The Context Let’s assume we have simple html structure like this: Table way (old way #1) In this method we’re using CSS to change our divs into tables. That’s why we can use table properties to align the content. Absolute-position way (old way #2)… Read more CSS: How to center content (multiple ways)

Posted on 22 February 201813 November 2018 by Michał Zięba
Proudly powered by WordPress | Theme: Sanse by Sami Keijonen.