5 Replies Latest reply on Dec 2, 2015 6:56 AM by osgood_

    Black Border Around Website?

    adrianc12058525 Level 1

      Hey guys,

       

      I am a teenager currently working on coding a website as a school project. Most things have been going smoothly, I have been following the templates from CS6. The only problem I currently have is that there are black gaps between the sidebar, content and footer. I have attached a picture of the issue below. If anybody could help me, that would be great. Thanks!help.PNG

        • 1. Re: Black Border Around Website?
          osgood_ Level 8

          adrianc12058525 wrote:

           

          Hey guys,

           

          I am a teenager currently working on coding a website as a school project. Most things have been going smoothly, I have been following the templates from CS6. The only problem I currently have is that there are black gaps between the sidebar, content and footer. I have attached a picture of the issue below. If anybody could help me, that would be great. Thanks!help.PNG

           

          Please post the page code and and any css that you have used in the forum. The black areas to the right and left look natural assuming you have specified a specific fixed width for your website. The black area between the footer and the content above looks like it should not be there but the answer to why is in the code.

          • 2. Re: Black Border Around Website?
            adrianc12058525 Level 1

            Hi osgood_,

             

            Thanks for the fast response! The black bars around the side is supposed to be there, but the bar between the content and footer is not. Here is my code:

             

            <!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"><!-- InstanceBegin template="/Templates/BandTemplate.dwt" codeOutsideHTMLIsLocked="false" -->

            <head>

            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

            <!-- InstanceBeginEditable name="doctitle" -->

            <title>Untitled Document</title>

            <!-- InstanceEndEditable -->

            <style type="text/css">

            <!--

            body {

              font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;

              background-color: #42413C;

              margin: 0;

              padding: 0;

              color: #000;

            }

             

             

            /* ~~ Element/tag selectors ~~ */

            ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */

              padding: 0;

              margin: 0;

            }

            h1, h2, h3, h4, h5, h6, p {

              margin-top: 0; /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */

              padding-right: 15px;

              padding-left: 15px; /* adding the padding to the sides of the elements within the divs, instead of the divs themselves, gets rid of any box model math. A nested div with side padding can also be used as an alternate method. */

            }

            a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */

              border: none;

            }

             

             

            /* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */

            a:link {

              color: #42413C;

              text-decoration: underline; /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */

            }

            a:visited {

              color: #6E6C64;

              text-decoration: underline;

            }

            a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */

              text-decoration: none;

            }

             

             

            /* ~~this fixed width container surrounds the other divs~~ */

            .container {

              width: 1024px;

              background-color: #FFF;

              margin: 0 auto;

              height: 768px; /* the auto value on the sides, coupled with the width, centers the layout */

            }

             

             

            /* ~~ the header is not given a width. It will extend the full width of your layout. It contains an image placeholder that should be replaced with your own linked logo ~~ */

            .header {

              background-color: #009dd1;

            }

             

             

            /* ~~ These are the columns for the layout. ~~

             

             

            1) Padding is only placed on the top and/or bottom of the divs. The elements within these divs have padding on their sides. This saves you from any "box model math". Keep in mind, if you add any side padding or border to the div itself, it will be added to the width you define to create the *total* width. You may also choose to remove the padding on the element in the div and place a second div within it with no width and the padding necessary for your design. You may also choose to remove the padding on the element in the div and place a second div within it with no width and the padding necessary for your design.

             

             

            2) No margin has been given to the columns since they are all floated. If you must add margin, avoid placing it on the side you're floating toward (for example: a right margin on a div set to float right). Many times, padding can be used instead. For divs where this rule must be broken, you should add a "display:inline" declaration to the div's rule to tame a bug where some versions of Internet Explorer double the margin.

             

             

            3) Since classes can be used multiple times in a document (and an element can also have multiple classes applied), the columns have been assigned class names instead of IDs. For example, two sidebar divs could be stacked if necessary. These can very easily be changed to IDs if that's your preference, as long as you'll only be using them once per document.

             

             

            4) If you prefer your nav on the right instead of the left, simply float these columns the opposite direction (all right instead of all left) and they'll render in reverse order. There's no need to move the divs around in the HTML source.

             

             

            */

            .sidebar1 {

              float: left;

              width: 180px;

              background-color: #009dd1;

              padding-bottom: 10px;

            }

            .content {

             

             

              padding: 10px 0;

              width: 844px;

              length: 800px;

              float: left;

              background-color: #c0c0c0

            }

             

             

            /* ~~ This grouped selector gives the lists in the .content area space ~~ */

            .content ul, .content ol {

              padding: 0 15px 15px 40px; /* this padding mirrors the right padding in the headings and paragraph rule above. Padding was placed on the bottom for space between other elements on the lists and on the left to create the indention. These may be adjusted as you wish. */

            }

             

             

            /* ~~ The navigation list styles (can be removed if you choose to use a premade flyout menu like Spry) ~~ */

            ul.nav {

              list-style: none; /* this removes the list marker */

              border-top: 1px solid #666; /* this creates the top border for the links - all others are placed using a bottom border on the LI */

              margin-bottom: 15px; /* this creates the space between the navigation on the content below */

            }

            ul.nav li {

              border-bottom: 1px solid #666; /* this creates the button separation */

            }

            ul.nav a, ul.nav a:visited { /* grouping these selectors makes sure that your links retain their button look even after being visited */

              padding: 5px 5px 5px 15px;

              display: block; /* this gives the link block properties causing it to fill the whole LI containing it. This causes the entire area to react to a mouse click. */

              width: 160px;  /*this width makes the entire button clickable for IE6. If you don't need to support IE6, it can be removed. Calculate the proper width by subtracting the padding on this link from the width of your sidebar container. */

              text-decoration: none;

              background-color: #009dd1;

            }

            ul.nav a:hover, ul.nav a:active, ul.nav a:focus { /* this changes the background and text color for both mouse and keyboard navigators */

              background-color: #ADB96E;

              color: #FFF;

            }

             

             

            /* ~~ The footer ~~ */

            .footer {

              padding: 10px 0;

              background-color: #CCC49F;

              position: relative;/* this gives IE6 hasLayout to properly clear */

              clear: both; /* this clear property forces the .container to understand where the columns end and contain them */

            }

             

             

            /* ~~ miscellaneous float/clear classes ~~ */

            .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 can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the #footer is removed or taken out of the #container */

              clear:both;

              height:0;

              font-size: 1px;

              line-height: 0px;

            }

            -->

            </style>

            <!-- InstanceBeginEditable name="head" -->

            <!-- InstanceEndEditable -->

            <script type="text/javascript">

            function MM_swapImgRestore() { //v3.0

              var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

            }

            function MM_preloadImages() { //v3.0

              var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

                var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

                if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

            }

             

             

            function MM_findObj(n, d) { //v4.01

              var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

                d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

              if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

              for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

              if(!x && d.getElementById) x=d.getElementById(n); return x;

            }

             

             

            function MM_swapImage() { //v3.0

              var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

               if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

            }

            </script>

            </head>

             

             

            <body onload="MM_preloadImages('Images/Feint%20Logo%202.png')">

             

             

            <div class="container">

              <div class="header"><a href="Index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Feint Logo','','Images/Feint%20Logo%202.png',1)"><img src="Images/Feint%20Logo.png" alt="Feint" width="192" height="108" id="Feint Logo" /></a><!-- end .header --><img src="Images/Banner.png" width="780" height="90" /></div>

              <div class="sidebar1">

                <ul class="nav">

                  <li><a href="Index.html">Home</a></li>

                  <li><a href="About%20Us.html">About Us</a></li>

                  <li><a href="Artists.html">Artists</a></li>

                  <li><a href="Song%20List.html">Song List</a></li>

                  <li><a href="Future%20Performances.html">Future Performances</a></li>

                  <li><a href="Merchandise.html">Merchandise</a></li>

                </ul>

                <p>If you enjoy our music, please consider purchasing some merchandise, it really helps to support us!</p>

                <p>  </p>

                <p> </p>

                <p> </p>

                <p> </p>

                <p> </p>

                <p> </p>

                <p> </p>

                <p> </p>

                <p><!-- end .sidebar1 --></p>

              </div>

              <div class="content"><!-- InstanceBeginEditable name="Content" -->

                <h1>Future Performances    </h1>

                <p>We are the band <em>Feint</em>, and we are a globally famous band that is interested in helping the world! Below is a list of our future performance venues and times, if you like our music consider coming to watch us perform live! All ticket proceeds will go to a charity of your choice. The live performances will include lots of fun and great music, you can buy tickets below.</p>

                <h2>Hong Kong</h2>

                <p> Hong</p>

                <table width="830" border="1">

                  <tbody>

                    <tr>

                      <td width="118"><img src="../Pictures/Hong_Kong_Coliseum_Seats.jpg" alt="" width="205" height="154" /></td>

                      <td width="696">Hong Kong - We will be performing in our hometown, Hong Kong at the Hong Kong Cultural Centre. All ticket money will be heading towards a charity that you can choose from below. We will be performing our new album, <em>Lift</em>, and various other songs live at the venue.</td>

                    </tr>

                  </tbody>

                </table>

                <table width="831" border="1">

                  <tbody>

                    <tr>

                      <td width="205"><img src="Images/Seaside-Park-Concerts_V1.jpg" width="205" height="128" alt=""/></td>

                      <td width="602">New York City -</td>

                    </tr>

                  </tbody>

                </table>

                <p> </p>

                <p> </p>

                <p>  </p>

                <p> </p>

                <p> </p>

                <p> </p>

                <p> </p>

              <!-- InstanceEndEditable --><!-- end .content --></div>

              <div class="footer">

                <p><br />

                </p>

                <!-- end .footer --></div>

              <!-- end .container --></div>

            </body>

            <!-- InstanceEnd --></html>

             

            Please don't mind any personal info/writing, my project is about a fake band ^-^

            • 3. Re: Black Border Around Website?
              osgood_ Level 8

              The code you pasted is NOT the code for the page you showed in your image and does not show the black gap between the footer and the content above it?

               

              You have added some other code to the page in your image which is causes the problem. I see you are using a lot of empty <p></p> tags to try and level up the side bar and the content area, that wont work.

               

              Below is a much more stable way of achieving equal height columns:

               

               

              <!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>

              body {

              font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;

              background-color: #42413C;

              margin: 0;

              padding: 0;

              color: #000;

              }

              .container {

              width: 1024px;

              margin: 0 auto;

              }

              .header {

              background-color: #009dd1;

              }

              .header h2 {

                  margin: 0;

                  padding: 0;

              }

              .sidebar-content-wrapper {

              display: table;

              }

               

              .sidebar1 {

              display: table-cell;

              width: 180px;

              background-color: #009dd1;

              }

               

              .content {

              display: table-cell;

              width: 844px;

              background-color: #c0c0c0

              }

               

              .footer {

              background-color: #CCC49F;

              }

              .footer h2 {

                  margin: 0;

                  padding: 0;

              }

               

              </style>

              </head>

               

              <body>

               

              <div class="container">

               

              <div class="header">

              <h2>Header</h2>

              </div>

              <!-- end header -->

               

              <div class="sidebar-content-wrapper">

               

              <div class="sidebar1">

              <h2>Sidebar 1</h2>

               

              <p>Some content goes here</p>

              <p>Some content goes here</p>

              <p>Some content goes here</p>

              <p>Some content goes here</p>

              <p>Some content goes here</p>

              <p>Some content goes here</p>

              <p>Some content goes here</p>

              <p>Some content goes here</p>

              </div>

              <!-- end sidebar1 -->

               

              <div class="content">

              <h2>Content</h2>

              <p>Some content goes here</p>

               

              </div>

              <!-- end content -->

               

               

               

              </div>

              <!-- end sidebar_content-wrapper -->

               

               

              <div class="footer">

               

              <h2>Footer</h2>

               

              </div>

               

               

              </div>

              <!-- end container -->

              </body>

              </html>

              1 person found this helpful
              • 4. Re: Black Border Around Website?
                adrianc12058525 Level 1

                Thanks. Sorry I didn't copy in the original code, I accidentally skipped to the wrong page. But when I paste in your code, it comes up with this:

                 

                help 2.PNG

                Is it supposed to be like this?

                • 5. Re: Black Border Around Website?
                  osgood_ Level 8

                  adrianc12058525 wrote:

                   

                  Thanks. Sorry I didn't copy in the original code, I accidentally skipped to the wrong page. But when I paste in your code, it comes up with this:

                   

                  help 2.PNG

                  Is it supposed to be like this?

                   

                  It's the way DW shows the construction in design view. If you view the page in a live browser the grey area will be next to the blue side bar. DW has limitations when you work in design view, it's not great at showing the page as it should be. Hopefully for those that rely heavily on a visual representation the upcoming version will be a vast improvement.

                   

                  Make sure you have display: table; for the sidebar-content-wrapper css  (I spelt it incorrectly in my first post and corrected it)

                   

                  .sidebar-content-wrapper {

                  display: table;

                  }

                  1 person found this helpful