Danyial Shahid Ali
Danyial Shahid Ali

Reputation: 511

How To Grow Div Height Top Side

My problem Is I Want To Grow My Div Height Top Side With Out Using Position:absolute; enter image description here

<html>
<head>
    <style>
        .StartMenu{}
    </style>
</head>
      <body>
            <div class="StartMenu">
                <div class="item" ></div>
            </div>

      </body>
 </html>

Upvotes: 0

Views: 312

Answers (4)

Saurabh Moses Ram
Saurabh Moses Ram

Reputation: 59

use padding if you want space inside Div. use margin if you want your div to be moved.

<html>
<head>
<style>
    .mydiv{
          padding-top:30px; // all elements inside div will move 30px down.
          margin-top:20px; // your div will move 20px down from parent tag.
      }
</style>
</head>
  <body>
        <div class="mydiv">
            <div class="item" ></div>
        </div>

  </body>

Upvotes: 0

Mohaideen Ismail
Mohaideen Ismail

Reputation: 314

You can use

padding:100px 0 0 0;

or

margin:100px 0 0 0;

Upvotes: 0

R Lam
R Lam

Reputation: 393

On the other way, padding-top can do what you want.

https://jsfiddle.net/a8ff1fg8/

Upvotes: 1

ketan
ketan

Reputation: 19341

I think you need like:

.StartMenu{
    height: 100px;
    border:1px solid;
    margin-top:-50px;
}
<div class="StartMenu">
                <div class="item" ></div>
            </div>

Hope it helps.

Upvotes: 1

Related Questions