Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 



Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > Design Forum > Web Design & Programming
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read


Web Design & Programming Discussion of web design, and server-side & client-side scripting

Reply
 
LinkBack Thread Tools
Old 05-03-2007, 04:35 AM   #1 (permalink)
TSF Enthusiast
 
KoosHopeloos's Avatar
 
Join Date: Nov 2004
Posts: 555
OS: Windows XP Pro & Windows Vista Ultimate browsing the web with FF, Opera, Safari and IE.


<div>: can't get content under header

L.S.,

I'm trying to make a layout which is completely fixed in width and height if needed by using three divs rows (header, content, footer) which have each 3 div again to be able to play around better with the webdesign.

The problem is that I need the content div row to nudge up automatically to the header div row, independantly of the header height. The same goes for the footer/content div row.

Any suggestions how to do this?

Thanks,

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Copyright JNvB</title>
  <style type="text/css">

/* header */

.headerrow {
position: absolute;

}
.logo {
position: absolute;
margin-left: 0px;
height: 200px;
width: 200px;
background-color: #0000FF;
}

.header {
position: absolute;
margin-left: 200px;
height: 200px;
width: 565px;
background-color: #00FF00;
}

.empty1 {
position: absolute;
margin-left: 765px;
height: 200px;
width: 5px;
background-color: #FF0000;
}

/* end header */

/* content */

.contentrow {
position: absolute; 
}

.menu {
float: left;
width: 200px;
background-color: #00FF00;
}

.content {
float: left;
width: 565px;
background-color: #FF0000;
}

.empty2 {
float: left;
width: 5px;
background-color: #0000FF;
}

/* end content */

/* footer */

.footerrow {
position: absolute;
}

.totop {
position: absolute;
margin-left: 0px;
height: 100px;
width: 200px;
background-color: #FF0000;
}

.footer {
position: absolute;
margin-left: 200px;
height: 100px;
width: 565px;
background-color: #0000FF;
}

.empty3 {
position: absolute;
margin-left: 765px;
height: 100px;
width: 5px;
background-color: #00FF00;
}

/* end footer */

</style>
</head>

<body>
<div class="headerrow">
<div class="logo">logo</div>
<div class="header">header</div>
<div class="empty1">empty1</div>
</div>

<div class="contentrow">
<div class="menu">menu</div>
<div class="content">content</div>
<div class="empty2">empty2</div>
</div>

<div class="footerrow">
<div class="totop">totop</div>
<div class="footer">footer</div>
<div class="empty3">empty3</div>
</div>

</body>
</html>
__________________
KoosHopeloos, straight to you from .nl via the world wide web!

KoosHopeloos is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here

Old 05-03-2007, 06:18 AM   #2 (permalink)
Retired
 
gamerman0203's Avatar
 
Join Date: Oct 2005
Location: Grand Rapids, MI
Posts: 2,144
OS: XP MCE, Ubuntu Gutsy

My System

Re: <div>: can't get content under header

do you have to have it positioned absolutely? what I like to do is just have everything relative, or not at all essentially. You just want a header div with a content div under that and then a footer div under that, correct? Not absolutely positioning your divs would create this effectively and easily. You would just have to set widths to make sure they are all the same.
gamerman0203 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 05-03-2007, 07:04 AM   #3 (permalink)
TSF Enthusiast
 
KoosHopeloos's Avatar
 
Join Date: Nov 2004
Posts: 555
OS: Windows XP Pro & Windows Vista Ultimate browsing the web with FF, Opera, Safari and IE.


Re: <div>: can't get content under header

@ gamerman0203: well, I'm completely redesigning my site and I'm new to CSS.

Quote:
You just want a header div with a content div under that and then a footer div under that, correct?
You are right, with that it is independent of the height of each row. For example, the height of the content column is not fixed and the footer row must be under the content row. And I need to keep each row divided in three....

Quote:
Not absolutely positioning your divs would create this effectively and easily.
Could you give me an example how to do this? I have tried so many things, but I couldn't get it to work!

Thanks for the help!
__________________
KoosHopeloos, straight to you from .nl via the world wide web!

KoosHopeloos is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 05-03-2007, 09:51 AM   #4 (permalink)
Retired
 
gamerman0203's Avatar
 
Join Date: Oct 2005
Location: Grand Rapids, MI
Posts: 2,144
OS: XP MCE, Ubuntu Gutsy

My System

Re: <div>: can't get content under header

if you were to just take out "position:absolute" for the header, content, and footer, it would automatically position them relative. Basically, it will "stack" the divs on top of each other in the order that your have them placed in the code.
gamerman0203 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 05-03-2007, 01:57 PM   #5 (permalink)
TSF Enthusiast
 
KoosHopeloos's Avatar
 
Join Date: Nov 2004
Posts: 555
OS: Windows XP Pro & Windows Vista Ultimate browsing the web with FF, Opera, Safari and IE.


Re: <div>: can't get content under header

@ gamerman0203: I followed your advice and removed the "position: absolute" from each div row declaration. But iso sitting one under the other, they stack on top of each other. I've tried a couple of other things, and this seems to work best, but now I do not have a header/content/footer row anymore...

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Copyright JNvB</title>
  <style type="text/css">

.column_menu {
position: absolute;
margin-left: 0px;
}

.column_content {
position: absolute;
margin-left: 200px;
}

.column_empty {
position: absolute;
margin-left: 765px;
}

/* header */

.logo {
height: 200px;
width: 200px;
background-color: #0000FF;
}

.header {
height: 200px;
width: 565px;
background-color: #00FF00;
}

.empty1 {
height: 200px;
width: 5px;
background-color: #FF0000;
}

/* end header */

/* content */

.menu {
width: 200px;
background-color: #00FF00;
}

.content {
width: 565px;
background-color: #FF0000;
}

.empty2 {
width: 5px;
background-color: #0000FF;
}

/* end content */

/* footer */

.totop {
height: 200px;
width: 200px;
background-color: #FF0000;
}

.footer {
height: 200px;
width: 565px;
background-color: #0000FF;
}

.empty3 {
height: 200px;
width: 5px;
background-color: #00FF00;
}

/* end footer */

</style>
</head>

<body>
<div class="column_menu">
<div class="logo">logo</div>
<div class="menu">menu</div>
<div class="totop">totop</div>
</div>

<div class="column_content">
<div class="header">header</div>
<div class="content">HTML is oorspronkelijk ontwikkeld om informatie via hypertext-documenten te ontsluiten voor verschillende platforms (zoals Windows, Macintosh en Unix). Bij de weergave van HTML-documenten ging het niet om een mooie, door de auteur geheel vastgelegde lay-out. Uitgangspunt was dat de informatie in een heldere structuur aan een bezoeker geboden moest worden. Bijvoorbeeld door de informatie in te delen met behulp van koppen van verschillend gewicht en paragrafen.

Met het toenemende gebruik van het internet ontstond bij webauteurs steeds meer de behoefte aan extra mogelijkheden bij de opmaak van documenten. Op deze behoefte is door de ontwikkelaars van browsers (Netscape en Microsoft) ingespeeld door het introduceren van nieuwe elementen en attributen. Sommige van deze elementen en attributen werden breed geaccepteerd, maar bij andere elementen bleef de ondersteuning beperkt tot één enkele browser. Webauteurs zelf gebruikten hun creativiteit om binnen de bestaande mogelijkheden van HTML meer invloed op de opmaak van hun documenten te krijgen. Voorbeelden zijn het gebruik van tabellen om de inhoud op een bepaalde plaats te krijgen en het omzetten van tekst in een afbeelding. De verstrengeling van structuur en presentatie die hierdoor ontstaat, heeft tot gevolg dat het niet meer zeker is dat een document altijd in elke browser en op elk platform goed te bekijken is.

Als oplossing voor dit probleem zijn stylesheets geïntroduceerd. De achterliggende gedachte is de scheiding tussen structuur en presentatie: HTML moet weer zorgen voor de structuur van het document, de presentatie wordt bepaald met behulp van in stylesheets vastgelegde stijlen.

De taal waarmee stylesheets worden gemaakt, heet Cascading Style Sheets (CSS) en is ontwikkeld door het World Wide Web Consortium (W3C). De laatste specificatie van Cascading Style Sheets (CSS 2) bevat een groot aantal mogelijkheden bij de opmaak van HTML-documenten en in toekomstige versies zal dit aantal alleen maar toenemen.

De volgende afbeeldingen geven een (beperkt) overzicht van wat CSS te bieden heeft. De rechter afbeelding is een schermafdruk van de weergave in een browser die stylesheets ondersteunt. De linker afbeelding laat zien hoe hetzelfde document wordt weergegeven zonder gebruik te maken van stijlen.</div>
<div class="footer">footer</div>
</div>

<div class="column_empty">
<div class="empty1">empty1</div>
<div class="empty2">empty2</div>
<div class="empty3">empty3</div>
</div>

</body>
</html>
__________________
KoosHopeloos, straight to you from .nl via the world wide web!

KoosHopeloos is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 05-04-2007, 10:26 AM   #6 (permalink)
Retired
 
gamerman0203's Avatar
 
Join Date: Oct 2005
Location: Grand Rapids, MI
Posts: 2,144
OS: XP MCE, Ubuntu Gutsy

My System

Re: <div>: can't get content under header

hmm.. I miss understood I guess. I thought you wanted them to stack on top of each other? Can you maybe post a screenshot of what you have and explain what you want?
gamerman0203 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 05-05-2007, 07:41 AM   #7 (permalink)
TSF Enthusiast
 
KoosHopeloos's Avatar
 
Join Date: Nov 2004
Posts: 555
OS: Windows XP Pro & Windows Vista Ultimate browsing the web with FF, Opera, Safari and IE.


Re: <div>: can't get content under header

@ gamerman0203: I solved my problem! I have tried really a lot of things, but I finally found out how to do it! I post it later...

Thanks for your help anyway!
__________________
KoosHopeloos, straight to you from .nl via the world wide web!

KoosHopeloos is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -7. The time now is 05:52 AM.



Copyright 2001 - 2009, Tech Support Forum
Home Tips Plus | Outdoor Basecamp | Automotive Support Forum

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85