html - Elements won't float properly -


when make attempt float paragraph left happens: enter image description here

with code:

 /* story styles */           #story {            height: 872px;          }           /* paragraph stles  */          div#story p {           float: left;           display: block;           color: #666666;           font-size: 26px;           font-family: brandongrotesque-regular, sans-serif;           width: 424.667px;          }            /* right div */            div#right {           width: auto;           float: left;          }
 <div class="container" id="quick">                   <div id="nav-logo">                      <img src="site_logo.png" alt="site logo" />                  </div>                 </div>                            <div class="container">              <div id="story">                              <p>                                 @ robeks, every choice make goodone!                                can trust make delicious, good-for-you                               smoothies , juices using best fruits,                          fresh vegetables, , natural ingredients. believe                                   shouldn’t have sacrifice taste                               healthy alternative – or health tasty one.                              make easy , enjoyable take care of                                   yourself.                              </p>                              <p>                          whatever choose guaranteed nutritious                                 tasty , delicious. small choice @                          robeks makes big difference. trust robeks create                            hand-crafted, great-tasting, nutritious alternatives                           keep energized , satisfied. have                        enough choices make in day. robeks easy one.                              </p>                                            <div id="right">                          <img src="about2017.jpg" alt="menu image" />                      </div>              </div>              </div>

and without "display: block" & "float: left" on p element browser displays:

/* story styles */    #story {      height: 872px;  }    /* paragraph stles  */  div#story p {      float: left;      display: block;      color: #666666;      font-size: 26px;      font-family: brandongrotesque-regular, sans-serif;      width: 424.667px;  }    /* right div */    div#right {      width: auto;      float: left;  }
 <div class="container">              <div id="story">                              <p>                                  @ robeks, every choice make one!                                   can trust make delicious, good-for-you                                   smoothies , juices using best fruits,                                  fresh vegetables, , natural ingredients. believe                                   shouldn’t have sacrifice taste                                   healthy alternative – or health tasty one.                                   make easy , enjoyable take care of                                   yourself.                              </p>                              <p>                                  whatever choose guaranteed nutritious                                   tasty , delicious. small choice @                                   robeks makes big difference. trust robeks create                                   hand-crafted, great-tasting, nutritious alternatives                                   keep energized , satisfied. have                                   enough choices make in day. robeks easy one.                              </p>                      </div>                                            <div id="right">                          <img src="about2017.jpg" alt="menu image" />                      </div>              </div>

i know second error because of paragraphs not being floated left, how make paragraphs appear in second snippet , allow image stacked beside 2 paragraphs.

goal:enter image description here

#story {      height: 872px;      display: inline-flex;  }    .p-left,.p-right {      width: 65%;      margin: auto;      display: inline-block;      text-align: left;  }    .p-div {      width: 76.5%;      display:inline-block;      text-align:center;  }  div#right {      width: 23.5%;      margin-top: 30px;      margin: 35px 15px;  }    div#right img{    margin: 35px 0px;    }      div#story p {       display: inline-block;       color: #666666;       font-size: 26px;       margin:20px 0px;       font-family: brandongrotesque-regular, sans-serif;       width: 100%;      }
<div class="container">  <div id="story">                       <div class="p-div"> <div class="p-left">  <p>                             @ robeks, every choice make goodone!                            can trust make delicious, good-for-you                           smoothies , juices using best fruits,                      fresh vegetables, , natural ingredients. believe                               shouldn’t have sacrifice taste                           healthy alternative – or health tasty one.                          make easy , enjoyable take care of                               yourself.                            </p></div>                          <div class="p-right"><p>                      whatever choose guaranteed nutritious                             tasty , delicious. small choice @                      robeks makes big difference. trust robeks create                        hand-crafted, great-tasting, nutritious alternatives                       keep energized , satisfied. have                    enough choices make in day. robeks easy one.                              </p></div></div>                    <div id="right">                      <img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:and9gcrak2t25vgyb-4hionqrdtu9mvaptlirk3pwpeuueypbuvt1ryg0q" alt="menu image"><img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:and9gcrak2t25vgyb-4hionqrdtu9mvaptlirk3pwpeuueypbuvt1ryg0q" alt="menu image"><img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:and9gcrak2t25vgyb-4hionqrdtu9mvaptlirk3pwpeuueypbuvt1ryg0q" alt="menu image"><img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:and9gcrak2t25vgyb-4hionqrdtu9mvaptlirk3pwpeuueypbuvt1ryg0q" alt="menu image">                  </div>  			                            </div>                              </div>


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -