Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9287049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T19:34:24+00:00 2026-06-18T19:34:24+00:00

At first, when I say centered, I mean both, vertically and horizontally centered. I

  • 0

At first, when I say centered, I mean both, vertically and horizontally centered.

I have a table with several tiles (divs) like in Windows 8 with background.images.
Every tile has a centered label (also a div) with a description and a semi transparent background.

Now I’d like to add another div between the tile itself and the label. These div should have a semi-transparent background-color as an overlay of the underlying tile-image-div.

But when I add this overlay-div, my label is not centered horizontally anymore, it is placed at the top of the tile. How can I keep it centered?

This is my code on fiddle:
fiddle (please take a look)

(The problem in the fiddle code is this line:

<div class="SemiTransOverlay">

When I delete this div everything is centered correctly.
What do I have to change to keep everything centered and keep div?)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T19:34:26+00:00Added an answer on June 18, 2026 at 7:34 pm

    first of all why you are using tables for layout purposes? we are in 21st century, so start using div’s and for accomplishing the semi transparent div to place behind the label and vertically aligned label you need to use position: absolute; and top: -50%;, I’ve also modified line-height for div.SemiTransLabelGross and also used position: relative and z-index properties

    Demo

    CSS

    table.Kacheln
    {
        border-spacing: 5px;
        border-collapse:separate;
        border:0px;
    }
    
    .wrap {
        position: relative;
        height: 100%;
    }
    
    td.KachelFlavourGross01
    {
        text-align:center;
        /*background:url(../img/Div/bg.jpg) no-repeat 0 0;*/
        background-color:#FF0000;
        width:404px;
        height:200px;
    
    }
    
    div.SemiTransOverlay
    {   
        height:100%;
        width:100%;
        background-color:rgba(255, 255, 255, 0.5);
        position: absolute;
        z-index: 1;
    }
    
    div.SemiTransLabelGross
    {
        font-size:2em;
        font-family:Verdana;
        font-style:italic;
        line-height:60px;
        background-color: rgba(255, 255, 255, 0.75);
        width:404px;
        height:60px;
        z-index: 2;
        position: absolute;
        top: 50%;
        margin-top: -30px; /* Half of height */
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one table having 10 rows.Now on page load lets say first 7
First let me say I have read this useful article thoroughly and am using
I have two commands I execute frequently. Let's say the first is 'abcd' and
First I would like to say that I am new to this site, never
First off I should say that I don't have any experience in working with
I have a MAC OSX objective C application say first.app ,in which i use
Suppose i have a cookie set in first.com say user. Now i want to
I have installed sqlserver as namedinstance first .say(sqlnamed).later i have installed sharepoint and configured
Let me first say that I've searched Google and, although many have similar issues,
let me just first say that I have tried to cut the code below

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.