css problem. Can't lock it?

  • George L.
  • Bronze Member
  • Bronze Member
  • George L.
  • Posts: 2209
  • Loc: Malaysia

Post 3+ Months Ago

seems i have no control over the size of the page. I'm currently building a companion website for my club and i can't control the size of the webpage. Eg:The height keeps adding and user has to scroll down alot - i tried putting more contents but it only add up to the height.. i'm using dreamweaver . How can i fix the size or at least control it ?. [/img]
  • zaiah
  • Proficient
  • Proficient
  • zaiah
  • Posts: 375

Post 3+ Months Ago

Can I see the CSS and the HTML? Or better yet the site? Maybe the divs aren't closed properly. I'm new to this but I can try and help.
  • George L.
  • Bronze Member
  • Bronze Member
  • George L.
  • Posts: 2209
  • Loc: Malaysia

Post 3+ Months Ago

Code: [ Select ]
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
 font: 100% Verdana, Arial, Helvetica, sans-serif;
 background: #666666;
 margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
 padding: 0;
 text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
 color: #000000;
}
.thrColLiq #container {
 width: 80%; /* this will create a container 80% of the browser width */
 background: #FFFFFF;
 margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
 border: 1px solid #000000;
 text-align: left; /* this overrides the text-align: center on the body element. */
}
/* Tips for sidebars:
1. Since we are working in percentages, it's best not to use side padding on the sidebars. It will be added to the width for standards compliant browsers creating an unknown actual width.
2. Space between the side of the div and the elements within it can be created by placing a left and right margin on those elements as seen in the ".thrColLiq #sidebar1 p" rule.
3. Since Explorer calculates widths after the parent element is rendered, you may occasionally run into unexplained bugs with percentage-based columns. If you need more predictable results, you may choose to change to pixel sized columns.
*/
.thrColLiq #sidebar1 {
 float: left; /* this element must precede in the source order any element you would like it be positioned next to */
 width: 22%; /* since this element is floated, a width must be given */
 background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
 padding: 15px 0; /* top and bottom padding create visual space within this div */
}
.thrColLiq #sidebar2 {
 float: right; /* this element must precede in the source order any element you would like it be positioned next to */
 width: 23%; /* since this element is floated, a width must be given */
 background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
 padding: 15px 0; /* top and bottom padding create visual space within this div */
}
.thrColLiq #sidebar1 p, .thrColLiq #sidebar1 h3, .thrColLiq #sidebar2 p, .thrColLiq #sidebar2 h3 {
 margin-left: 10px; /* the left and right margin should be given to every element that will be placed in the side columns */
 margin-right: 10px;
}
/* Tips for mainContent:
1. the space between the mainContent and sidebars is created with the left and right margins on the mainContent div.
2. to avoid float drop at a supported minimum 800 x 600 resolution, elements within the mainContent div should be 300px or smaller (this includes images).
3. in the Internet Explorer Conditional Comment below, the zoom property is used to give the mainContent "hasLayout." This avoids several IE-specific bugs.
*/
.thrColLiq #mainContent {
 margin: 0 24% 0 23.5%; /* the right and left margins on this div element creates the two outer columns on the sides of the page. No matter how much content the sidebar divs contain, the column space will remain. You can remove this margin if you want the #mainContent div's text to fill the sidebar spaces when the content in each sidebar ends. */
}
/* Miscellaneous classes for reuse */
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
 float: right;
 margin-left: 8px;
}
.fltlft { /* this class can be used to float an element left in your page The floated element must precede the element it should be next to on the page. */
 float: left;
 margin-right: 8px;
}
.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain its child floats */
 clear: both;
 height: 0;
 font-size: 1px;
 line-height: 0px;
}
-->
</style><!--[if IE]>
<style type="text/css">
/* place css fixes for all versions of IE in this conditional comment */
.thrColLiq #sidebar2, .thrColLiq #sidebar1 { padding-top: 30px; }
.thrColLiq #mainContent { zoom: 1; padding-top: 15px; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]--></head>

<body class="thrColLiq">

<div id="container">
 <div id="sidebar1">
  <h3>Sidebar1 </h3>
  <p>The background color on this div will only show for the length of the content. If you'd like a dividing line instead, place a border on the left side of the #mainContent div if the #mainContent div will always contain more content than the #sidebar1 div. </p>
  <p>Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut, sapien. </p>
  <!-- end #sidebar1 --></div>
 <div id="sidebar2">
  <h3>Sidebar2 </h3>
  <p>The background color on this div will only show for the length of the content. If you'd like a dividing line instead, place a border on the right side of the #mainContent div if the #mainContent div will always contain more content than the #sidebar2 div. </p>
  <p>Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut, sapien. </p>
  <!-- end #sidebar2 --></div>
 <div id="mainContent">
  <h1> Main Content </h1>
  <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio. Donec et ipsum et sapien vehicula nonummy. Suspendisse potenti. </p>
  <h2>H2 level heading </h2>
  <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio.</p>
  <!-- end #mainContent --></div>
    <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --><br class="clearfloat" />
 <!-- end #container --></div>
</body>
</html>
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Untitled Document</title>
  6. <style type="text/css">
  7. <!--
  8. body {
  9.  font: 100% Verdana, Arial, Helvetica, sans-serif;
  10.  background: #666666;
  11.  margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
  12.  padding: 0;
  13.  text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
  14.  color: #000000;
  15. }
  16. .thrColLiq #container {
  17.  width: 80%; /* this will create a container 80% of the browser width */
  18.  background: #FFFFFF;
  19.  margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
  20.  border: 1px solid #000000;
  21.  text-align: left; /* this overrides the text-align: center on the body element. */
  22. }
  23. /* Tips for sidebars:
  24. 1. Since we are working in percentages, it's best not to use side padding on the sidebars. It will be added to the width for standards compliant browsers creating an unknown actual width.
  25. 2. Space between the side of the div and the elements within it can be created by placing a left and right margin on those elements as seen in the ".thrColLiq #sidebar1 p" rule.
  26. 3. Since Explorer calculates widths after the parent element is rendered, you may occasionally run into unexplained bugs with percentage-based columns. If you need more predictable results, you may choose to change to pixel sized columns.
  27. */
  28. .thrColLiq #sidebar1 {
  29.  float: left; /* this element must precede in the source order any element you would like it be positioned next to */
  30.  width: 22%; /* since this element is floated, a width must be given */
  31.  background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
  32.  padding: 15px 0; /* top and bottom padding create visual space within this div */
  33. }
  34. .thrColLiq #sidebar2 {
  35.  float: right; /* this element must precede in the source order any element you would like it be positioned next to */
  36.  width: 23%; /* since this element is floated, a width must be given */
  37.  background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
  38.  padding: 15px 0; /* top and bottom padding create visual space within this div */
  39. }
  40. .thrColLiq #sidebar1 p, .thrColLiq #sidebar1 h3, .thrColLiq #sidebar2 p, .thrColLiq #sidebar2 h3 {
  41.  margin-left: 10px; /* the left and right margin should be given to every element that will be placed in the side columns */
  42.  margin-right: 10px;
  43. }
  44. /* Tips for mainContent:
  45. 1. the space between the mainContent and sidebars is created with the left and right margins on the mainContent div.
  46. 2. to avoid float drop at a supported minimum 800 x 600 resolution, elements within the mainContent div should be 300px or smaller (this includes images).
  47. 3. in the Internet Explorer Conditional Comment below, the zoom property is used to give the mainContent "hasLayout." This avoids several IE-specific bugs.
  48. */
  49. .thrColLiq #mainContent {
  50.  margin: 0 24% 0 23.5%; /* the right and left margins on this div element creates the two outer columns on the sides of the page. No matter how much content the sidebar divs contain, the column space will remain. You can remove this margin if you want the #mainContent div's text to fill the sidebar spaces when the content in each sidebar ends. */
  51. }
  52. /* Miscellaneous classes for reuse */
  53. .fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
  54.  float: right;
  55.  margin-left: 8px;
  56. }
  57. .fltlft { /* this class can be used to float an element left in your page The floated element must precede the element it should be next to on the page. */
  58.  float: left;
  59.  margin-right: 8px;
  60. }
  61. .clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain its child floats */
  62.  clear: both;
  63.  height: 0;
  64.  font-size: 1px;
  65.  line-height: 0px;
  66. }
  67. -->
  68. </style><!--[if IE]>
  69. <style type="text/css">
  70. /* place css fixes for all versions of IE in this conditional comment */
  71. .thrColLiq #sidebar2, .thrColLiq #sidebar1 { padding-top: 30px; }
  72. .thrColLiq #mainContent { zoom: 1; padding-top: 15px; }
  73. /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
  74. </style>
  75. <![endif]--></head>
  76. <body class="thrColLiq">
  77. <div id="container">
  78.  <div id="sidebar1">
  79.   <h3>Sidebar1 </h3>
  80.   <p>The background color on this div will only show for the length of the content. If you'd like a dividing line instead, place a border on the left side of the #mainContent div if the #mainContent div will always contain more content than the #sidebar1 div. </p>
  81.   <p>Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut, sapien. </p>
  82.   <!-- end #sidebar1 --></div>
  83.  <div id="sidebar2">
  84.   <h3>Sidebar2 </h3>
  85.   <p>The background color on this div will only show for the length of the content. If you'd like a dividing line instead, place a border on the right side of the #mainContent div if the #mainContent div will always contain more content than the #sidebar2 div. </p>
  86.   <p>Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut, sapien. </p>
  87.   <!-- end #sidebar2 --></div>
  88.  <div id="mainContent">
  89.   <h1> Main Content </h1>
  90.   <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio. Donec et ipsum et sapien vehicula nonummy. Suspendisse potenti. </p>
  91.   <h2>H2 level heading </h2>
  92.   <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio.</p>
  93.   <!-- end #mainContent --></div>
  94.     <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --><br class="clearfloat" />
  95.  <!-- end #container --></div>
  96. </body>
  97. </html>
  • George L.
  • Bronze Member
  • Bronze Member
  • George L.
  • Posts: 2209
  • Loc: Malaysia

Post 3+ Months Ago

its the sample page from dreamweaver.
  • grinch2171
  • Moderator
  • Genius
  • User avatar
  • Posts: 6810
  • Loc: Martinsburg, WV

Post 3+ Months Ago

I'm trying to figure out what you want to happen. The more content you add the longer the page is going to get. That is just the basic facts.
  • zaiah
  • Proficient
  • Proficient
  • zaiah
  • Posts: 375

Post 3+ Months Ago

grinch2171 wrote:
I'm trying to figure out what you want to happen. The more content you add the longer the page is going to get. That is just the basic facts.


LOL. Sorry but I guess that only makes sense. Unless he wants scrollers to pop-up. If that is the case you want to add an overflow statement in there.

And loose that! It's got hacks in it. Find a hack-free 3 column layout. Just do a search there are a ton out there.

here's a good one: http://matthewjamestaylor.com/blog/perfect-3-column.htm

ALSO! If your site is going to have more than one page you may want to link the CSS file instead. This way you have to change the CSS once and it makes global changes.
  • George L.
  • Bronze Member
  • Bronze Member
  • George L.
  • Posts: 2209
  • Loc: Malaysia

Post 3+ Months Ago

Thanks Zaiah, and Grinch2171.

Sorry just finished my mailing part. Now getting back to this CSS . Will look into that.

good luck ,!

:)

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 33 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.