-1

Just with CSS, I would like to put the number of subscribers next to the logo

But with position : absolute the logo is on the text and if the text is in

float : right there are a problems

My program

<div>
    <h3>Suivez-nous</h3>
    <div class="Facebook">
        <img src="images/Facebook.png">
        <p>500 000 abonnés</p>
    </div>
    <div class="twitter">
        <img src="images/twitter.png">
    </div>
    <div class="instagram">
        <img src="images/instagram.png">
    </div>
</div>

All code in https://codepen.io/adri1212/pen/dgVVpK

This code is a just part of a footer and use a flexbox

Adri
  • 144
  • 8

3 Answers3

1

Just don't use <p> as its default display is block

Example

If you want to wrap your text - you can use <span> which is an inline element by default.

Example with span and margin

Itay Gal
  • 10,706
  • 6
  • 36
  • 75
1

As noted in the comments, <p> need to be removed, and the <div> elements need to be replaced with <span>

This will give you a single line of images with text between the images:

<footer>
    <div>
        <h3>Titre section 1</h3>
        <p>test</p>
    </div>
    <div>
        <h3>Titre section 2</h3>
    </div>
    <div>
        <h3>Titre section 3</h3>
    </div>

    <div>
        <h3>Suivez-nous</h3>
        <span class="Facebook">
            <img src="images/Facebook.png">
            500 000 abonnés
        </span>
        <span class="twitter">
            <img src="images/twitter.png">
        </span>
        <span class="instagram">
            <img src="images/instagram.png">
        </span>
        </div>
</footer>
JonathanDavidArndt
  • 2,518
  • 13
  • 37
  • 49
-1

I found a solution,

In the CSS I put

    .Facebook > p{
         display : inline;
    }
Adri
  • 144
  • 8
  • Probably a better solution might be wrapping it under a div and then `display: flex, flexDirection: row` – Alwaysblue Oct 14 '18 at 12:31
  • Okay, it's functional but not valid. – Adri Oct 14 '18 at 12:32
  • I think to use flex-direction but the other people I found solution so it's goob – Adri Oct 14 '18 at 12:32
  • Agree that this will work, but you would do better using a different tag that already displays inline (such as ``) and simply adjust the margins. One of the whole points of using `

    ` is that it is a block level element, and this changes all that.

    – JonathanDavidArndt Oct 14 '18 at 12:43
  • Yes I use the solution (my previous message may not have been understood correctly ) – Adri Oct 14 '18 at 12:46