html css - split screen

BackEnd_Ash.log·2020년 6월 30일
0

Split screen using div

if you want use split screen using div
use float left

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" 
          content="width=device-width, height=device-height, 
                     minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0">
    <title>Insert title here</title>
    <style>
    div {
        width: 100%;
        height: 300px;
        
        border: 1px solid #000;
    }
    div.left {
        width: 50%;
        float: left;
        box-sizing: border-box;
        
        background: #ff0;
    }
    div.right {
        width: 50%;
        float: right;
        box-sizing: border-box;
        
        background: #0ff;
    }
    </style>
</head>
 
<body>
    <div>
        <div class="left"></div>
        <div class="right"></div>
    </div>
</body>
</html>

other method using div

<div id="container" style="width:500px">
  <div id="header" style="background:#ffa500;">
    <h1 style="margin-bottom:0;">Main Title</h1>
  </div>
<div id="menu" style="background:#ffd700; height:200px; width:100px float:left;">
  <b>Menu</b><br>
HTML<br>
CSS<br>
Javascript
</div>
<div id="content" style="background:#eeeeee; height:200px; width:400px; float:left;">show !!!</div>
</div>
profile
꾸준함이란 ... ?

0개의 댓글