I
I
Indus Indusovich2015-10-17 02:16:05
css
Indus Indusovich, 2015-10-17 02:16:05

How to align div img and div h2_?

The task is simple, but I can not find a solution in any way
, such a structure

<div class="col-lg-6">
    <div class="row">
        <div class="image"><a href="#"><img src="imagen.png"></a></div>
            <div class="text"><h2>Hello</h2></div>        
    </div>
</div>
    <div class="col-lg-6">
    <div class="row">
        <div class="image"><a href="#"><img src="imagen.png"></a></div>
            <div class="text"><h2>Hello</h2></div>        
    </div>
</div>

itmages.ru/image/view/3101282/3b1ef895
How to align a block with text next to a block with a picture? What would it be like next to a folder?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stalker_RED, 2015-10-17
@Indus999

float: left and padding like h2.
https://jsfiddle.net/rbkpqunw/
Well, either inline-block, or combine the image and text into one div. Why do you have separate .image and .text blocks?

A
Alexander Golubev, 2015-10-17
@Piocan-Alex

Can be easily reduced to:

<div class="col-lg-6 row">
        <a class="image" href="#"><img src="imagen.png"></a>
        <h2 class="text">Hello</h2>
</div>

The result will be the same.
For alignment add to a.image {float: left}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question