How to put image and text on the side with FlexBox?

0

Hey guys, I'm having trouble positioning the image and text ON THE SIDE of the image. I tried table but it is not responsive. I tried ul / li and I can not position. I am using FlexBox. Any suggestions?

<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="UTF-8">
    	<meta name="viewport" content="width=device-width, initial-scale=1"/>
    	<title>About Us</title>
    	<link rel="stylesheet" type="text/css" href="css/style3.css">
    	<link rel="shortcut icon" href="images/logo.png">
    	<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" crossorigin="anonymous">
    	<link href="https://fonts.googleapis.com/css?family=Arimo" rel="stylesheet">
       <link href="https://fonts.googleapis.com/css?family=Bree+Serif" rel="stylesheet">
        <link href="https://fonts.googleapis.com/css?family=Raleway:400,700" rel="stylesheet">
    </head>
        
    <body>
        <section class="bg">
            <div class="auutor">
                <h1>The Author</h1>
            </div>
            <ul class="fuckk">
                <li>
                    <img src="images/1313.png"/>
                    <h1>Roft Salem Throme</h1>
                    <p>But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain.</p>
                </li>
            </ul>
        </section>
    </body>
</html>
    
asked by anonymous 13.08.2018 / 03:58

1 answer

1

You can use the display : flex property on your li by enclosing the title h1 and the p in a div , as follows:

<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="UTF-8">
    	<meta name="viewport" content="width=device-width, initial-scale=1"/>
    	<title>About Us</title>
    	<link rel="stylesheet" type="text/css" href="css/style3.css">
    	<link rel="shortcut icon" href="images/logo.png">
    	<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" crossorigin="anonymous">
    	<link href="https://fonts.googleapis.com/css?family=Arimo" rel="stylesheet">
       <link href="https://fonts.googleapis.com/css?family=Bree+Serif" rel="stylesheet">
        <link href="https://fonts.googleapis.com/css?family=Raleway:400,700" rel="stylesheet">

        <style type="text/css">
        	li {
        		list-style-type: none;
        	}

            .conteudo {
                display: flex;
            }

            h1 {
            	text-align: center;
            }

            li img {
                width : 20%;
                height: 20%;
                vertical-align: middle;
            }
        </style>
    </head>
        
    <body>
        <section class="bg">
            <div class="auutor">
                <h1>The Author</h1>
            </div>
            <ul class="fuckk">
                <li>
                	<h1>Roft Salem Throme</h1>
                    <div class="conteudo">
                    	<img src="https://www.freeiconspng.com/uploads/help-icon-26.png"/>
                        <p>But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain.</p>
                    </div>
                </li>
            </ul>
        </section>
    </body>
</html>
    
13.08.2018 / 04:47