2 replies [Last post]
jsntg
Offline
newbie
Last seen: 12 years 24 weeks ago
Timezone: GMT-8
Joined: 2009-05-11
Posts: 4
Points: 3

Hello,

Using Dreamweaver thrColHybHdr css and having a problem with the location of embedded web page in the main content area. Tried width="100%" height="100%" but page comes in tiny and stays tiny.

width="100%" height="700" is the height I want but the embedded page is centered in the main window when I want it at the top.

My html:

<!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/obkc.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Ocean Beach - Kelly's Cove Weather, Beach Cam and Resource Guide |  San Francisco, CA</title>
<link href="test4.css" rel="stylesheet" type="text/css" /><!--[if IE]>
<style type="text/css"> 
/* place css fixes for all versions of IE in this conditional comment */
.thrColHybHdr #sidebar1, .thrColHybHdr #sidebar2 { padding-top: 30px; }
.thrColHybHdr #mainContent { zoom: 1; padding-top: 15px; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]-->
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
#apDiv1 {
	position:absolute;
	width:867px;
	height:35px;
	z-index:1;
}
-->
</style>
</head>
 
<body class="thrColHybHdr">
 
<div id="container">
  <div id="header">
    <h2>ob-kc.com<br />
    <img src="images/obkc.jpg" width="605" height="67" alt="ocean beach kellys cove" /></h2>
  </div>
  <div id="header">
    <ul id="MenuBar1" class="MenuBarHorizontal">
      <li><a href="/index.html">Home</a></li>
      <li><a class="MenuBarItemSubmenu" href="#">Surf Cam</a>
        <ul>
          <li><a class="MenuBarItemSubmenu" href="#">Timelapse</a>
            <ul>
              <li><a href="#">1 HR Timelapse</a></li>
              <li><a href="#">6 HR Timelapse</a></li>
              <li><a href="#">12 HR Timelapse</a></li>
            </ul>
          </li>
          <li><a href="#">Gallery</a></li>
        </ul>
      </li>
      <li><a class="MenuBarItemSubmenu" href="#">Weather</a>
        <ul>
          <li><a href="#">Current Conditions</a></li>
          <li><a href="#">Highs & Lows</a></li>
          <li><a class="MenuBarItemSubmenu" href="#">Recent Historical Data</a>
            <ul>
              <li><a href="#">6 HR Graph</a></li>
              <li><a href="#">24 HR Graph</a></li>
              <li><a href="#">72 HR Graph</a></li>
            </ul>
          </li>
          <li><a href="#">Trends</a></li>
         <li><a class="MenuBarItemSubmenu" href="#">Forecasts</a>
            <ul>
              <li><a href="#">Weather</a></li>
              <li><a href="#">Marine</a></li>
              <li><a href="#">Waves</a></li>
            </ul>
          <li><a href="#">Tides</a></li>
          <li><a href="#">Sun & Moon</a></li>
        </ul>
      </li>
       <li><a class="MenuBarItemSubmenu" href="#">Recreation</a>
        <ul>
          <li><a class="MenuBarItemSubmenu" href="#">Surfing</a>
            <ul>
              <li><a href="#">Windsurfing</a></li>
              <li><a href="#">Kitesurfing</a></li>
              <li><a href="#">Surfing</a></li>
              <li><a href="#">Standup Paddle Boarding</a></li>
              <li><a href="#">Boogie Boarding</a></li>
              <li><a href="#">Surf Kayaking</a></li>
              <li><a href="#">Skateboarding</a></li>
            </ul>
          </li>
          <li><a href="#">Biking</a></li>
          <li><a href="#">Fishing</a></li>
          <li><a href="#">Swimming</a></li>
          <li><a href="#">Running & Hiking</a></li>
          <li><a href="#">Beach Events</a></li>
          <li><a href="#">Golden Gate Park</a></li>
          <li><a href="#">Lands End</a></li>
          <li><a href="#">Seal Rock</a></li>
          <li><a href="#">Local History</a></li>
        </ul>
      </li>
       <li><a class="MenuBarItemSubmenu" href="#">Local Flava</a>
        <ul>
          <li><a class="MenuBarItemSubmenu" href="#">Kelly's Cove</a>
            <ul>
              <li><a href="http://fullspherestudio.com/">Full Sphere Studio</a></li>
              <li><a href="http://www.yelp.com/biz/fredys-ocean-beach-deli-san-francisco">Freddy's Deli</a></li>
              <li><a href="http://www.on-trackcleaners.com/">On-Track Cleaners</a></li>
              <li><a href="http://www.wisesurfboards.com/">Wise Surf Shop</a></li>
              <li><a href="#">Europa Express Grocery</a></li>
              <li><a href="http://www.beachchalet.com/">Beach / Park Chalet</a></li>
              <li><a href="http://www.cliffhouse.com/">Cliff House</a></li>
              <li><a href="http://barrabrothersca.com/index_files/home.html">Barra Brother's Jiu Jitsu Academy</a></li>
              <li><a href="#">Expert Cut Hair Salon</a></li>
            </ul>
          </li>
          <li><a class="MenuBarItemSubmenu" href="#">Judah</a>
            <ul>
              <li><a href="#">Java Beach</a></li>
              <li><a href="#">Beach Burrito</a></li>
              <li><a href="#">Judalicous</a></li>
              <li><a href="#">Other Avenues</a></li>
              <li><a href="#">Sea Breeze Cafe</a></li>
              <li><a href="#">Thanh Long</a></li>
              <li><a href="#">Thai Cottaget</a></li>
              <li><a href="#">Sri Thai</a></li>
            </ul>
          </li>
          <li><a class="MenuBarItemSubmenu" href="#">Outer Richmond</a>
            <ul>
              <li><a href="#">KL Chinese Restaurant</a></li>
              <li><a href="#">Hunan Cafe #2</a></li>
              <li><a href="#">Tai Shan Cafe</a></li>
              <li><a href="#">Best Panda Restaurant</a></li>
              <li><a href="#">Shanghai House</a></li>
              <li><a href="#">Kams Chinese Restaurant</a></li>
              <li><a href="#">Simple Pleasures Cafe</a></li>
              <li><a href="#">Traktir</a></li>
              <li><a href="#">Miki's Restaurant</a></li>
              <li><a href="#">Zephyr Cafe</a></li>
            </ul>
          </li>
        </ul>
      <li><a href="http://ob-kc.com/about.html">About</a></li>
      <li><a href="#">&nbsp;</a></li>
      <li><a href="#">&nbsp;</a></li>
      <li><a href="#">&nbsp;</a></li>
      <li><a href="#">&nbsp;</a></li>
      </li>
    </ul>
    <br class="clearfloat" />
  </div>
  <div id="sidebar1">
  	<iframe height="220" width="100%" margin="0" frameborder="0" src="http://www.ob-kc.com/images/wx.html">your browser does not support IFRAMEs</iframe>
<div id="button"> <strong><a href="currwx.html">Current Conditions</a></strong></div>
<table width="170" border="0" align="center"><br />
  <tr>
    <td></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<h4><br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
  <br />
</h4>
  <!-- end #sidebar1 --></div>
  <div id="sidebar2">
    <h3><br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
	  <br />
	  <br />
      <br />
      <br />
      <br />
      <br />
      <!-- end #sidebar2 -->
    </h3>
</div>
  <!-- InstanceBeginEditable name="Main Content" -->
  <div id="mainContent">
    <object data=http://ob-kc.com/wxlive/wxlive.html width="100%" height="700">
      <embed src=http://ob-kc.com  width="100%" height="100"> </embed>
      Error: Embedded data could not be displayed.
    </object>
    <!-- end #mainContent -->
  </div>
  <!-- InstanceEndEditable -->
 <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --><br class="clearfloat" />
   <div id="footer">
    <table border="0">
    <tr>
  <td><img src="http://www.webdevelopmenttutorials.com/public/counter-image.php?display=uniques&style=15" border="0" />
<br /><span style="font-size:5%;"></span></td></tr>
</table>
  <!-- end #footer --></div>
<!-- end #container --></div>
<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
</body>
<!-- InstanceEnd --></html>

_____________________________________________________________________
My CSS
@charset "utf-8";
body  {
	background: #FFF;
	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 */
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 100%;
}
 
/* Tips for this Hybrid layout
1. Since the side columns em-based sizing is based on the user's default font size, you will want to be sure that background graphics in the columns take that into account. Built correctly, this is more accessible for those that need larger font sizes, since the width of the columns remains proportionate. If this is undesirable with your design, simply change the width to a pixel size and be sure to change the margins on the #mainContent div accordingly.
2. Since the sizing of side columns in this layout are based on the 100% font size in the body element, if you decrease the text size overall by using a font-size: 80% on the body element or the #container, remember that the column widths will downsize proportionately. You may want to increase their widths, and the size of the #mainContent div's side margins, to compensate for this.
3. If font sizing is changed in differing amounts on each div instead of on the overall design (ie: #sidebar1 is given a 70% font size and #mainContent is given an 85% font size), this will proportionately change each of the divs overall size. You may want to adjust based on your final font sizing.
4. The #container div is not necessary for this layout at the 100% width. You may want to use it to create faux columns or limit the width of the layout.
5. It is not neccessary to have the 100% width on the #container div since, by nature, a div takes up 100% of the available space. It is here so that if you want to decrease the size of the overall container - perhaps leaving a bit of margin on each side - this will already be available for adjustment.
*/
.thrColHybHdr #container {
	width: 100%;
	background: #FFFFFF;
	/*margin: 0 auto;  the auto margins (in conjunction with a width) center the page if needed */
	text-align: left;
}  
.thrColHybHdr #container2 {
	background: #FFFFFF;
	padding-left: 10px;
	padding-top: 16px;
}  
.thrColHybHdr #header {
	padding: 0 0px;  /* 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. */
	width: 120em;
	margin-left: 10px;
} 
.thrColHybHdr #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 */
}
.thrColHybHdr #header h2 {
	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 */
	color:#F60
}
.thrColHybHdr #button {
	color:#036;
	background-color: #EF F5F0;
	border-color: #CCC;
	border-width: 1px 1px 1px 1px;
	border-style: outset outset outset outset;
	border-spacing: 1px;
	border-collapse: separate;
	font-size: 14px;
}
 
/* Tips for sidebar1:
1. Be aware that if you set a font-size value on this div, the overall width of the div will be adjusted accordingly.
2. Since we are working in ems, it's best not to use padding on the sidebar itself. It will be added to the width for standards compliant browsers creating an unknown actual width. 
3. 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 ".thrColHybHdr #sidebar1 p" rule.
*/
.thrColHybHdr #sidebar1 {
	float: left;
	width: 11em; /* since this element is floated, a width must be given */
	background: #EBEBEB;
	padding-top: 0;
	padding-right: 0;
	padding-bottom: 0px;
	padding-left: 0px;
	text-align:center;
	margin-left: 10px;
}
.thrColHybHdr #sidebar2 {
	float: right; 
	width: 11em; /* 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 */
}
.thrColHybHdr #sidebar1 h3, .thrColHybHdr #sidebar1 p, .thrColHybHdr #sidebar2 p, .thrColHybHdr #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. If you give this #mainContent div a font-size value different than the #sidebar1 div, the margins of the #mainContent div will be based on its font-size and the width of the #sidebar1 div will be based on its font-size. You may wish to adjust the values of these divs.
2. The space between the mainContent and sidebar1 is created with the left margin on the mainContent div.  No matter how much content the sidebar1 div contains, the column space will remain. You can remove this left margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends.
3. To avoid float drop, you may need to test to determine the approximate maximum image/element size since this layout is based on the user's font sizing combined with the values you set. However, if the user has their browser font size set lower than normal, less space will be available in the #mainContent div than you may see on testing.
4. In the Internet Explorer Conditional Comment below, the zoom property is used to give the mainContent "hasLayout." This avoids several IE-specific bugs that may occur.
*/
.thrColHybHdr #mainContent {
	margin-top: 0;
	margin-right: 12em;
	margin-bottom: 0;
	margin-left: 12em;
	padding-top: 1em;
	padding-right: .75em;
	padding-bottom: 0;
	padding-left: 1em;
} 
.thrColHybHdr #footer {
	padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
	background:#FFF;
} 
.thrColHybHdr #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 */
	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 a float */
	clear:both;
    height:0;
    font-size: 1px;
    line-height: 0px;
}
#photo {
	width: 100%;
	height: auto;
	margin-bottom: -20px;
	border-color: #000;
}

Any help with solving this position issue would be greatly appreciated.

Hugh

jsntg
Offline
newbie
Last seen: 12 years 24 weeks ago
Timezone: GMT-8
Joined: 2009-05-11
Posts: 4
Points: 3

Picture

The whitespace at the yellow arrow is what I'm trying to eliminate.

downtap
downtap's picture
Offline
Enthusiast
Dallas, TX
Last seen: 7 years 18 weeks ago
Dallas, TX
Timezone: GMT-7
Joined: 2008-01-18
Posts: 227
Points: 36

Do you have a live link?

Do you have a live link? Also, I'd suggest avoiding using Dreamweaver's built in templates.