开发者

Setting up web page width

I am new to web-design. I want to set the page-width so that it appears well in a 800x600 resolution screen. I normally use Tables but I read 开发者_StackOverflowsomewhere that excessive use of Tables slows the performance of the website. What other thing I can use and how to set the width?


Usings DIVs rather than tables would look like this

   <div style="width:800px">
     <!-- your content here -->
   </div>

This produces on column with the width of 800 pixels. Keep in mind that you normally may put your style definitions in an externals *.css file. In reality you will have some nested DIVs too which hold e.g. your main menu and content e.g.

   <div id="wrapper">
     <div id="topMenu">
       <!-- menu items -->
     </div>

     <div id="content">
       <!-- content -->
     </div>
   </div>

Here I have used IDs for specific items which can be addressed uniquely. It's easy to assign styles to them via CSS:

#wrapper {
  width:800px;
}

#topMenu {
  width:800px;
  height:200px;
}

Sooner or later you will stumble upon the term "floating divs" which is another big topic.


Yes, Tables are so 1995....

Now you're supposed to use DIVs and SPANs.

http://www.smashingmagazine.com/2009/04/08/from-table-hell-to-div-hell/

also, w3schools are the normal resource for html starters

but, why bother, you can use an already made layout from websites like: http://www.freelayouts.com/websites/html-templates

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜