Web Design Forums

Welcome! Please register or log in: Forgot your password? Why register?
You are here: Web Design Forums » Web Design Help » HTML and CSS Help » Can't Make Page Full Width - HTML/CSS Prob RSS

Can't Make Page Full Width - HTML/CSS Prob

This thread was started by MikuruX and has been viewed 447 times, and contains 10 replies, with the last reply made by Dorky.
Post Reply
1
View MikuruX's reputation
MikuruX, WDF Noob Private message  
Posted January 24 '10 at 05:25 PM
      Posts: 3
Hello!

This is my first time ever trying to make a website using CSS to make a web page. I'm currently using Dreamweaver CS4 (noob with this also) and I've managed to get the basic layout of my page done but when I check it in a browser, It never comes out to full width/height and I keep getting the white border around the far edges of my page.

Live Example: http://www.animetoshokan.org/template.html

Here is what my current code looks like so far:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" ><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" >
<head>
<title>Anime Toshokan Inc. :: We've Been Waiting For You! :: Ver 11.1 :: Revival Serenade</title>
<style type="text/css">
#body {background: #ffffff;
       border-left: solid;
       border-left-width: 0;
       border-right: solid;
       border-right-width: 0;
       border-top-style: solid;
       border-top-width: 0;
       border-bottom-style: none;
       border-bottom-width: medium;
       }

#header {background: #0000ff;
         background-image: url(headerbg.png);
         border-left: solid;
         border-left-width: 0;
         border-right: solid;
         border-right-width: 0;
         border-top-style: solid;
         border-top-width: 0;
         border-bottom-style: none;
         border-bottom-width: medium;
         }

#menu {background: #00ff00;
       background-image: url(menubarbg.png);
       }

#maincol {background: #ffffff;
          background-image: url(contentbg.png);
          background-repeat: no-repeat;
          }

#footer {background: #ff0000;
         background-image:url(footerbg.png);
         }

</style>
</head>



<body id="body">
<div id="pagewidth">
<!--------- Header Area --------->
<div id="header">

<center>
<table width="100%" cellpadding="0" cellspacing="0" border="0" bordercolor="#111111"  style="height: 168px">
 <tr valign="top">
     <td height="168">
     
     
     
     </td>
 </tr>
</table>
</center>


</div>

<!--------- Main Menu Area --------->
    <div id="menu" >

<center>
<table width="100%" cellpadding="0" cellspacing="0" border="0" bordercolor="#111111"  style="height: 75px">
 <tr valign="top">
     <td height="75">
     
     
     
     </td>
 </tr>
</table>
</center>


</div>

<!--------- End of Main Content Area --------->


<!--------- Main Content Area --------->
<div id="maincol" >
<center>
<table width="85%" bgcolor="#ffffff" cellpadding="0" cellspacing="0" border="0" bordercolor="#111111"  style="height: 800px">
 <tr valign="top">
     <td height="180">
     
     Main Content Here
     
     </td>
 </tr>
</table>
</center>
</div>
<!--------- End of Main Content Area --------->

<!--------- Footer Area --------->
    <div id="footer" >
    
<center>    
    <table width="85%" cellpadding="0" cellspacing="0" border="0" bordercolor="#111111"  style="height: 80px">
 <tr valign="top">
     <td height="80">
     
     
     
     </td>
 </tr>
</table>
</center>
</div>
<!--------- End of Footer Area --------->
    </div>
</body>
</html>

Can anyone help me out with this by pointing out my error or giving me some tips on what to do so I wont this kind of mistake again?

Advertisement Register for free to hide these ads and participate in discussions!

2
34 points at 74%
Dorky, Freelance Home page   Private message  
Posted January 24 '10 at 06:58 PM
      Posts: 784
add this line in the body css

margin: 0px;

3
View MikuruX's reputation
MikuruX, WDF Noob Private message  
Posted January 24 '10 at 07:22 PM
      Posts: 3
Ah! That did the trick. Thank you so much for that, I really appreciate it. ^^

4
34 points at 74%
Dorky, Freelance Home page   Private message  
Posted January 24 '10 at 08:35 PM
      Posts: 784
very cool, glad i could help.

5
View 5online's reputation
Posted February 2 '10 at 08:04 AM
      Posts: 1
following will work:
for css :
background: #ffffff;
background-image: url(contentbg.png);
background-repeat: no-repeat;

for table:

<table width="100%" cellpadding="0" cellspacing="0" border="0" bordercolor="#111111" style="height: 75px">
<tr valign="top">
<td height="75">



</td>
</tr>
</table>

6
105 points at 96% Repute
diddy, [insert witty comment here] Private message   E-mail
Posted February 6 '10 at 11:08 PM
      Posts: 473
Glad that you got the help you're looking for.

Just wanted to point some things out in your code (remembering that you're a noob).

Try not to use the <center> tag. text-align: center; will work just fine in CSS. Try to do as much with CSS as you pssibly can. Remember your XHTML doctype and stick to it. Try to use DIVs over <table> for site layout. Tables are for tabular data, not website layout.
I found it a great help going to these links, it'll clear a lot up:
http://www.w3schools.com/css
http://www.w3schools.com/xhtml
http://w3schools.com/tags/default.asp
Was my or another members' post helpful in any way? If so, please click the thumbs up ( ) above the post to signal a good quality post.
W3C | XTHML Validator | CSS Validator | WDF Rules

7
34 points at 74%
Dorky, Freelance Home page   Private message  
Posted February 8 '10 at 12:55 PM
      Posts: 784
text-align: center; is for text, as implied by the leading word "text". center is just fine providing you are not using it with position: absolute; and the proper way to center using css is to declare a width and left/right auto margins.

when talking down to a noob, be sure you dont look as one yourself.

8
34 points at 74%
Dorky, Freelance Home page   Private message  
Posted February 8 '10 at 12:59 PM
      Posts: 784
oh yes, and to center for a dynamic width use position: absolute; width: auto; and declare your left/right px.

9
105 points at 96% Repute
diddy, [insert witty comment here] Private message   E-mail
Posted February 8 '10 at 05:01 PM
      Posts: 473
<center>, while technically not 'wrong" (allthough in html 5 it probably will be) is frowned upon by the w3c. There are better ways imo.
Was my or another members' post helpful in any way? If so, please click the thumbs up ( ) above the post to signal a good quality post.
W3C | XTHML Validator | CSS Validator | WDF Rules

10
105 points at 96% Repute
diddy, [insert witty comment here] Private message   E-mail
Posted February 10 '10 at 04:31 AM
      Posts: 473
the thing is that you full width then you need to give table width 100% so it will extend as much as resolution streches .
Yes, that will work. In fact it works in any element, for example tables and divs.
I would wrap the site in a div, not a table, but the point is that the 100% width statement is the key. But definately use the CSS:

width: 100%;
Was my or another members' post helpful in any way? If so, please click the thumbs up ( ) above the post to signal a good quality post.
W3C | XTHML Validator | CSS Validator | WDF Rules

11
34 points at 74%
Dorky, Freelance Home page   Private message  
Posted February 10 '10 at 07:56 PM
      Posts: 784
is frowned upon by the w3c
no such thing in data. 1 or 0 - on or off - true or false.

Post Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Frontpage basics tonyf12 Software Articles & Tutorials 9 January 26 '10 07:29 AM
full screen html page for swf file shekar Adobe Photoshop Help 4 January 14 '06 02:15 AM
Wanted..nice person to make a cute layout for a personal page love310 Request a Service 2 July 28 '05 03:02 AM
Efficient PHP/MySQL Page Counter futureal PHP 5 June 10 '03 01:03 AM
how to make a page where people can talk and listen? aladdin 6184 Website Ratings and Reviews 0 April 17 '03 10:56 AM