html - CSS beginner, help creating this layout? -


in image below, on left output of html/css, on right layout like.

i'm pretty clueless to:

  • how center header
  • why 'upper right' text , button being forced next line header (as opposed orienting in upper right
  • how align text area right of image

<html>     <head>         <link rel="stylesheet" type="text/css" href="style.css">     </head>     <body>         <div class="outer_border">             <div class="inner_border">                 <!--just use div represent image -->                 <div class ="image">                 </div>                 <span class="upper_left_text">                     upper left                 </span>                 <span class ="header">                     <h2>                         header                     </h2>                 </span>                 <span class="upper_right_text">                     upper right                 </span>                 <button class="button1">button</button>                 <textarea class="text_area">text area</textarea>                 <button class="button2">button 2</button>             </div>         </div>     </body> </html>  .outer_border {     border: 1px solid black;     width: 600px;     height: 500px; }  .inner_border {     border: 3px solid black;     width: 400px;     height: 300px;     float: right; }  .image {     border: 1px solid black;     display: inline-block;     width: 50px;     height: 100px;     margin: 5px;     float: left; }    .the_header {     text-align: center;     display: inline-block; }  .button1 {     float: right; }  .button2 {     float: right;     width: 80px;     height: 60px; }  .text_area {     clear: both;     display: block;     width: 100%;     height: 150px;     margin: 5px;     /*i have no idea how position this*/ }  .upper_left_text {     float: left; }  .upper_right_text {     float: right; } 

enter image description here

i made jsfiddle, check one, should started :)

https://jsfiddle.net/fazbyxyq/

html5

<div class="right">     <div>upper left</div>     <div>header</div>     <div>upper right</div>     <div><textarea>textarea</textarea></div>     <div>button2</div> </div> 

css3

*{ box-sizing:border-box; -moz-box-sizing:border-box; }  .left{     float:left;     width:10%;     height:100px;     border:1px solid #000; }  .right{     float:left;     width:89%;     margin-left:1%; }  .right div{     float:left;     width:33%;     border:1px solid #000; }  .right div:nth-child(2){     text-align:center; }  .right div:nth-child(3){     text-align:right; }  .right div:nth-child(4),.right div:nth-child(5){     width:99%;     border:0; }  .right div:nth-child(4) textarea{     width:100%;     height:100px;     margin:10px 0; }  .right div:nth-child(5){     text-align:right; } 

peace out!


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -