PDA

View Full Version : Gap between main content and sidebar 2


manchora
09-04-2013, 12:46 PM
I have a flash banner with changing pictures in my main content. In dreamweaver design view, there is no gap between the flash banner and sidebar 2. However when i preview it in browser there is a gap. How do i get rid of the gap

The config.xml for the banner is

<?xml version= "1.0" encoding= "utf-8"?>
<config xmlSource="banner.xml" slideDuration="3" slideTransitionDuration="1" captionTransition="Strong" captionTransitionDuration="1" fontsXMLSource="fonts.xml" fontsEmbedded="false" frameWidth="490" frameHeight="230" frameBgColor="0x707070" frameBgTransparent="0" framePaddingTop="0" framePaddingBottom="0" framePaddingLeft="20" framePaddingRight="0" frameCornerRadius="0" controlsBarColor="0x000000" controlsBarTransparent="0.75" controlsColor="0xFFFFFF" controlsHighlight="0xF9D455" controlsBgColor="0xFFFFFF" controlsBgTransparent="0.15">
</config>


The CSS for the page layout is

@charset "utf-8";
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;
}
.thrColLiqHdr #container {
width: 62%; /* this will create a container 80% of the browser width */
background: #FFFFFF; /* the auto margins (in conjunction with a width) center the page */
border: 7px ridge #7A8D0D;
border-radius: 20px;
text-align: left; /* this overrides the text-align: center on the body element. */
margin-top: 0;
margin-right: auto;
margin-bottom: 0;
margin-left: auto;
}
.thrColLiqHdr #header {
padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
background-image: none;
background-color: #FFFFFF;
border-top-left-radius: 20px;
border-top-right-radius: 20px;
border-bottom-width: 10px;
border-bottom-style: solid;
border-bottom-color: #754F2A;
}
.thrColLiqHdr #header h1 {
margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
}

/* 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 ".thrColLiqHdr #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.
*/
.thrColLiqHdr #sidebar1 {
float: left; /* this element must precede in the source order any element you would like it be positioned next to */
width: 17%; /* top and bottom padding create visual space within this div */
padding-top: 0px;
padding-right: 0;
padding-bottom: 15px;
padding-left: 0;
border-right-width: 1px;
border-right-style: solid;
border-right-color: #CCC;
background-color: #EEEEEE;
}
.thrColLiqHdr #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;
padding-top: 0px;
padding-right: 0;
padding-bottom: 0px;
padding-left: 0;
margin: 0px;
}
.thrColLiqHdr #sidebar1 p, .thrColLiqHdr #sidebar1 h3, .thrColLiqHdr #sidebar2 p, .thrColLiqHdr #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.
*/
.thrColLiqHdr #mainContent {
margin-top: 0;
margin-right: 24%;
margin-bottom: 0;
margin-left: 18.5%;
padding-top: 12px;
padding-right: 0px;
padding-bottom: 0px;
padding-left: 0px;
}

.thrColLiqHdr #mainContent h1 {margin: 0; padding: 0;}


.thrColLiqHdr #footer {
padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
background:#DDDDDD;
border-bottom-left-radius: 20px;
border-bottom-right-radius: 20px;
}
.thrColLiqHdr #footer p {
margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
}

/* 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;
}

http://i43.tinypic.com/1azbs.jpg

gentleone
09-05-2013, 08:34 AM
Sidebar2 is floated to the right, so it will go as far as it can. You don't see a gap in DW design view because of DW's GUI. A browser window is wider, so therefore the gap.

Read the comments in the CSS file. It's all there explained.