Welcome to Idea R | Branding - Web Agency - Digital Strategies
Switch to the mobile layout

      Idea R - Do others know who you are? Design your corporate identity
  • HomeHome
  • About UsAbout Us
  • ContactsContacts

Blog

Take a software geek from the 80s, add a new generation graphic designer and dilute with a long time marketing strategist. Shake vigorously and you'll get the Idea R's blog.

Change language... italiano

You may be interested in

How to skip the CDN during ASP.NET development

How to skip the CDN during ASP.NET development

How to inject the Content Delivery Network URL in the production website without having to hardcode it.

How to fix your ASP.NET site to be responsive on Windows Phone

Internet Explorer 10 for Windows Phone 8 suffers a bug when displaying responsive web sites. See how to fix it server-side with few lines of code.

Last published

How to design a FAKE B2C brand for a real B2B service

How to design a FAKE B2C brand for a real B2B service

Interesting case study where to advertise B2B services we created a fake B2C product in a guerrilla marketing campaign.

Irritated by your blog performance? Boost it using the cloud!

Are you using the world's fastest hosting? If you have a bad architecture, your blog won't have a great performance. Here is the ultimate solution.

Most popular

Lazy loading and the SEO problem, solved!

Lazy loading and the SEO problem, solved!

The best SEO solution to index your dynamically loaded contents, no more compromises!

Case study: IED Open Day, building a font by hand... literally

These days graphic design is mainly the result of software tools. Here's a case study where a brand is designed with glue and scissors

Editor's pick

Mental marketing secret #1: the fake compromise

Mental marketing secret #1: the fake compromise

Can mentalism influence marketing? As a marketing professional and a long term magician, I will reveal you some tricks.

How to dramatically increase social media LIKEs to your web site

Here's a free download that I created some time ago. It's a good tool for increasing engagement, but use with caution.
newsletter

Stay informed on digital strategies

RSS feed

Centrare i testi con CSS

Published on 11/7/2011
Tags: CSS, HTML, Tutorials
Centrare i testi con CSS

Per centrare verticalmente un contenuto, si deve usare il seguente codice CSS

div.vCenterWrapper
{
    height: 100%;
    display: table;
    overflow: hidden;
}
div.vCenterContainer
{
    display: table-cell;
    vertical-align: middle;
}
div.vCenterContent
{
}

ed il seguente HTML

<div class="vCenterWrapper">
    <div class="vCenterContainer">
        <div class="vCenterContent">
            ...
        </div>
    </div>
</div>

Il codice CSS però purtroppo non funziona con le versioni precedenti la 8 di Internet Explorer: bisogna aggiungere il seguente codice condizionale

[if lt IE 8.]>
<style type="text/css">
    div.vCenterWrapper
    {
        position: relative;
    }
    div.vCenterContainer
    {
        position: absolute;
        top: 50%;
    }
    div.vCenterContent
    {
        position: relative;
        top: -50%;
    }
</style>
<![endif]

Se si deve centrare anche orizzontalmente la tentazione sarebbe quella di usare la centratura del testo:

<div class="vCenterWrapper" style="text-align:center;">
    <div class="vCenterContainer">
        <div class="vCenterContent">
            ...
        </div>
    </div>
</div>

Purtroppo questo sistema funziona con tutti tranne che con Internet Explorer 6 e Internet Explorer 7.
La maniera corretta di farlo, per centrare ad esempio in una colonna di 500 pixel, è di modificare gli stili:

div.vCenterWrapper
{
    height: 100%;
    width: 500px;
    display: table;
    overflow: hidden;
}
div.vCenterContainer
{
    display: table-cell;
    vertical-align: middle;
}
div.vCenterContent
{
    width: 500px;
    margin-left: auto;
    margin-right: auto;
    text-align:center;
}

You are the reader number 3,393.

Comments

comments powered by Disqus
Creative Commons License

Photographies, videos, graphics and texts by Idea R are licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

Previous article

Previous article

Reflections on the water with Photoshop

Next article

JavaScript events? What a mess!

Next article
  • Visual Communication, Art DirectionVisual Communication, Art Direction
  • Apps, Cloud, Mobile, Software DesignApps, Cloud, Mobile, Software Design
  • Digital StrategiesDigital Strategies
  • BlogBlog
Touching finger
RSS feed
Blog

Scroll to top