Reputation: 1024
I can't use percentages in height and vertical margins-paddings. It doesn't matter almost, but I have to vertical center a div and I have to use
#ana > #kapak > .ğ-contey > .anabaslik-kutusu
{
top: 50%;
transform:translateY(-50%);
}
that code but top not working.
Please Help.
Upvotes: 1
Views: 53
Reputation: 129
I corrected your fiddle
You cannot use the "top" attribute unless you add "position". For example like this:
#ana > #kapak > .ğ-contey > .anabaslik-kutusu
{
position: relative;
top: 50%;
transform:translateY(-50%);
}
Upvotes: 3
Reputation: 1024
Add:
#ana > #kapak > .ğ-contey > .anabaslik-kutusu { position:relative; }
Upvotes: 0
Reputation: 764
I don't really get your problem. If you're trying to achieve vertical centering this article should help. But it's known problem with height in css. Sometimes it's better to use js than height percentages.
Also be sure you can use negative margins, it's really helpful.
Upvotes: 1