I am having problems with divs and height. I notice this is a very common problem, I have tried many of the fixes and I am still running into problems.
I am working on this page.
My problem is the Div columns will not stretch to 100%, or 100% seems to be the users screen height and not the content height. I would like all the columns to stretch to the height of the page content. http://www.rewitec.ca/index.php?CategoryID=53
I am using an external style sheet.
Here is the code: -
/************ PAGE LAYOUT *****************************/
-
-
html,body {
-
-
float:left;
-
background-image: url(images/background.png);
-
background-repeat: repeat;
-
height: 100%;
-
margin:0;
-
padding:0;
-
-
}
-
-
/************ HEADER **********************************/
-
-
#header {
-
-
float: left;
-
width: 100%;
-
height: 114px;;
-
background-image: url(images/h_spacer.png);
-
background-repeat: repeat-x;
-
background-position: top;
-
-
}
-
-
-
#headerpic {
-
-
background-attachment:fixed;
-
background-position: top, center;
-
-
}
-
-
-
/************ HORIZONTAL NAVIGATION BAR *************/
-
-
#h_Nav {
-
-
float: left;
-
width: 100%;
-
display: inline;
-
-
background-color: rgb(60,60,60);
-
-
margin-bottom: 3px;
-
-
}
-
-
/*********** LOGIN FORM **************************************/
-
-
.Login {
-
-
float: right;
-
width: 100%;
-
-
text-align: right;
-
text-decoration: none;
-
font-family: tahoma;
-
font-size: 10;
-
font-weight: bold;
-
color: white;
-
-
}
-
-
.LoginButton {
-
-
background-color: rgb(68, 84, 108);
-
text-align: center;
-
text-decoration: none;
-
font-family: tahoma;
-
font-size: 9;
-
color: white;
-
-
-
}
-
-
.LoginTextbox {
-
-
text-decoration: none;
-
font-family: tahoma;
-
font-size: 9;
-
font-weight: bold;
-
color: black;
-
-
-
}
-
-
-
-
-
/************ PAGE BODY ************************************/
-
-
#border_left{
-
float: left;
-
width: 33px;
-
height: 100%;
-
background-image: url(images/border_left.png);
-
background-repeat: repeat-y;
-
background-position: top;
-
-
}
-
-
#border_right{
-
float: left;
-
width: 46px;
-
height: 100%;
-
background-image: url(images/border_right.png);
-
background-repeat: repeat-y;
-
background-position: top;
-
-
}
-
-
-
#ContentBody {
-
-
float: left;
-
width: 692px;
-
height: 100%;
-
background-color: rgb(255,255,255);
-
}
-
-
-
#TextContent {
-
-
background-color: rgb(255,255,255);
-
height: 100%;
-
margin-top: 8px;
-
margin-right: 8px;
-
margin-bottom: 8px;
-
margin-left: 8px;
-
}
-
-
-
/*********** VERTICLE NAVIGATION ******************************/
-
-
#v_NavBody {
-
-
float: left;
-
width: 150px;
-
height: 100%;
-
background-color: rgb(69,147,216);
-
-
}
-
-
.v_Nav {
-
-
background-color: rgb(0,0,0);
-
text-decoration: none;
-
font-family: tahoma;
-
font-size: 12;
-
font-weight: bold;
-
color: white;
-
-
}
-
-
.v_SubNav {
-
-
background-color: rgb(255,255,255);
-
text-decoration: none;
-
font-family: tahoma;
-
font-size: 12;
-
font-weight: bold;
-
color: black;
-
-
-
}
-
-
-
form {
-
margin-top: -1em;
-
margin-bottom: 0;
-
display: inline;
-
}
-
Here is the page code:
[html]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Rewite c Canada</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href='style.css ' rel='stylesheet ' type='text/css'>
</head>
<body>
<div id='header'><di v id='headerpic'> <img src='images/header.png' alt='Rewitec Canada'></div></div>
<div id='border_left '></div>
<div id='v_NavBody'> TEXT</div>
<div id='ContentBody '>
<div id='h_Nav'>TEXT </div>
TEXT
</div>
<div id='border_righ t'></div>
</body>
</html>
[/html]
please take a look at this category on the page in both FF and IE.
Where am I going wrong
Thank you for any help
4 1453
When you use percentage, the question to ask is "Percent of what?" Normally it would be the percent of the containing/parent element. But, if so, what is the size of that parent? That needs a defined size and, if it, too, is in percent then...percent of what?
In your case, you show the html, body and other elements set to float. Floating removes that element from the normal flow and some of them may be losing their reference point. Try to let elements fall where they may without positioning them and decrease the need to float everything.
Your doctype is incorrect and IE will go into quirks mode. Use this one:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"> These CSS errors need fixing.
Thanks for the quick reply.
I'll fix these problems to the best of my ability. Wow changing the doctype has mixed everything up, this might take a bit.
Again thank you. I'm sure I'll be back with more questions shortly.
The reason things change is because we are changing the rules. No doctype means rendering in quirks, which is so 20th century. Current standards require the doctype I showed you. For more info, see the article about doctypes in the Howto section above.
I have fixed the errors and the page is now layed out correctly in FF and IE.
The last problem I am have is how do I make my left and right borders and nav_body height relative to the content height.
I am new to css (I'm sure you noticed)
I'm not sure where to begin fixing this. I have removed the height: 100% from the body and this seems to allow the content div to stretch correctly, but leaves my #border_left, #border_right and #v_NavBody from showing..does not stretch to the content height.
Sorry to be such a newb with css, but I'm learning.
If the percent is based on the parent container, This means that I need to create a container that holds all the columns and have that stretch to fit the content? ....making all the columns stretch to fill this container ?
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Tyler Carver |
last post by:
I am trying to create a table that 100% of the viewport with three
rows. The top and bottom rows have a fixed height and the center row
I want to take up the rest of the space. This work fine in Mozilla
but I cannot control the row height exactly in IE. They work like
min-heights. Here is the code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
|
by: Tyler Carver |
last post by:
I am trying to create a table that is 100% of the viewport with three
rows. The top and bottom rows have a fixed height and the center row
I want to take up the rest of the space. This work fine in Mozilla
and Opera but I cannot control the row height exactly in IE. Row
heights are working more like min heights.
Here are two examples.
http://hughaxton.com/newsgroups/IETableRowHeight.html
This one shows the height of the table at...
|
by: cpt |
last post by:
I read that if one uses "table-layout:fixed"
then table rendering is speeded by setting row height. All my rows
are 285 px high.
1) Is this true?
2) If true, how does one set row-height for the table,
preferable with a CSS style?
Thanks, CMA
|
by: lauren quantrell |
last post by:
A while back I got a requirement for the client to be able to adjust
the relative heights of two subforms by click-dragging the mouse and I
came up with a kludge solution using a border control between the two
subforms. But I put my mind to this again recently and came up with a
solution (code below) that works well with multiple subforms to size
both the heights and widths of the sunforms relative to each other, and
it uses no additional...
|
by: Beringer |
last post by:
Does anybody know a way to get the heights of the various lines of text in a
RichTextBox?
I'm not sure if "height" is the proper term. But what I'm getting at is
that if you set the
font size of some selected text on a line the entire line "height" expands
to the new font
size.
I want that!
| |
by: tshad |
last post by:
Why are the text box heights of the input/file type textbox for uploading
files a smaller height than a normal textbox?
They have the exact same font and the same size font.
But the heights are smaller for the upload textbox for some reason.
I wanted to make them look the same, but can't figure out how to change
them - or can you?
|
by: sfeher |
last post by:
Hi All,
I am having trouble big times figuring out a way of forcing a DIV to be
in synch with another DIV's height in a (mostly vertically) fluid
layout in a web app context. The first one has overflow-x:auto; and a
width set but not a height as I want it to vertically grow with the
text inside.
Basically I would like the same height for the second one. I care less
if it is CSS, tables or Javascript but I would prefer the solution to
|
by: hestres |
last post by:
Hello,
I'm having trouble figuring out how to make sure that all my DIVs in
this layout are of the same height. Here's an example of a page where
I'm having this problem:
http://www.house.gov/velazquez/test/issues/index.html
As you can see, the main content column (the white one) cuts off while
the sidebar (yellow) keeps going. I want the white column to be the
|
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= |
last post by:
I want to be able to increase or decrease row heights of a populated
DataGridView from the keyboard. I set up a test program with menu items to
increase and decrease, assigned shortkey keys (ctrl-UpArrow and
ctrl-DnArrow), and attached handlers that execute this code:
public partial class MainForm : Form
{
. . .
dataGridView.RowTemplate.Height += increment;
Refresh();
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |