/*
/*
*/ /*
*/
-->*/

A lesson in coding with xhtml and css. The correctly coded box is the third one down, just above the XHTML code outline used.

I present this page to you with the idea that we learn from our mistakes.  The first two coded boxes are mistakes.  Have fun!

toc>

This is a weird page, I'll admit. It is my effort to repair a page coded in CSS-2 that I could not get to work. I believe I have the problem solved now, but we'll see.

What I did was create color blocks for each of the major divs used in the code.  Then I placed the colored blocks here to see how they behaved. 

The last set of blocks is what I think will work for my pages.  I will title it "Workable Contents Section" and place a comment in the code above that point so that you can find it among the blocks that obviously do not work.

What I was trying to do was create a page section to be placed below the masthead.  In this section would be 3 columns.  The major contents of the page would go in the middle section that would have divisions itself.  The middle section was tested with an ad banner, text, and two large divisions.

I saved my old CSS style sheet for you to use in studying this page.  It is the stylesheet linked to this page, and it is a mess!  You will notice that I redid the divs for this page in the header.  From what I learned in doing this page, the new style sheet for the gbox pages was reorganized and rewritten. 

One lesson that I learned is that the browsers do not behave exactly like you would expect when you follow the rules.  Also,  the width of the boxes lined up side by side is critical.  If your width is too tight, Firefox will extend the second floated div to the end of the box containing it.  Also, if you put anything too big inside the div, this second div grows wider despite the assignment of width--or at least it seemed to.  After a bit, the mistakes accumulate until it is hard to tell what is happening. 

If  you learned from this page, do let me know. 

 

 

page

ads

 

Well, this block was failure #2.

toc adj
page2

ads

 

 

 

 

 

page

adlist
this space

page

page

 

footer adj

The block below is the workable section.

I have redone the original css code to reflect these corrections.

 

toc

page2: this section would contain the main contents of the page.

Banner

 

Why the section begins midway is because this section of text is not in a paragraph tag. It seems to be a function of the align right property. I will place the next words in a paragraph tag.

This div would separate from the next div with a break. catlk


pgad

This is additional text for the middle column.

ads

Below is the XHTML code for the boxes in the section that works minus the text.  Watch out.  Breaks have been added to make reading the code easier.  Sections of code were indented for the same reason.

<div class="content">
      <div class="toc">toc
          </div> <!--close toc comment -->
      <div class="pg2">pg 2
                      <p></p>
                                  <p>banner<p>
                                  <div class="catlk"><p>catlk</p></div>
                      <br />
                      <div class="pgad">pgad</div>
                      <p>This is additional text for the middle column.</p>
           </div><!-- close pg 2 comment-->
       <div class="ads">ads
          </div><!-- close ads comment-->
      <div class="footer">footer
          </div> <!-- close footer comment -->
   </div><!-- close contents -->

This page was produced by Valerie of Valerie Coskrey's Classroom Tools and Ideas. If you learned from it, let me know.