V
V
Vachagan Danielyan2015-06-01 22:38:45
css
Vachagan Danielyan, 2015-06-01 22:38:45

How to move a rubric to the news preview?

How to move the gray background with the category name over the topic preview image?
1. Either on top of the image
2. Or on the bottom of the image
Website: GeekNinja.ru
44604ffab2534df7bd201f39c1d60f40.pngPhoto for example

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Ineshin, 2015-06-01
@Hanatos

Like this: jsfiddle.net/IonDen/p47Lkssj

.pic {
    position: relative;
    float: left;
    width: 250px;
    height: 150px;
    margin: 0 10px 10px 0;
    background-color: #ccc;
    background-position: 50% 50%;
    background-size: cover;
}

.pic-text {
    position: absolute;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px;
    width: 100%;
    box-sizing: border-box;
    color: #fff;
}
.pic-text.top {
    top: 0;
}
.pic-text.bottom {
    bottom: 0;
}

D
Dmitry Shinkar, 2015-06-02
@DeadCowsDontMoo

I'm too lazy to write code, but I see it for myself as a picture in a div, in the same div there is another div, it has a button (or a button right away). The button (or the div in which the button is) has a higher z-index... Done =)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question