How to define the dimensions of an HTML page?

Asked

Viewed 38,817 times

0

I’m using Dreamweaver and now I’ve tried the website, and the page gets really wide. How I can control the width and height of the page?

  • 1

    Could you put in some of your code? Otherwise, it gets really hard to guess what’s going on with you.

2 answers

5

You can use the attributes height (height) and width (width) in pixels or percent in the style of body or by CSS. But it’s good practice to be in CSS.

In the CSS:

body {
   height:200px; 
   width:100px;
}

and/or

 body {
    height:100%; 
    width:50%;
 }

In HTML:

<body style="height:100%; width:50%;">
  • E Usually what is the size of the web page.ie, The page up and down depends but in terms of width?

  • That depends on what you want, but if you do width:100% will take up your window browser in full.

5

You can put to center the page and still put proportional so:

.wrapper{
max-width: 1000px;
width: 100%;
margin: 0 auto;
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.