Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Bidding Directory   World's Leading Outsourcing Network   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 05-09-2007, 08:02 AM   #1 (permalink)
Inactive
 
Join Date: 03-12-07
Posts: 17
iTrader: 0 / 0%
Latest Blog:
None

CookieHost is liked by many
Question CSS layer stretch

Hi,

I'm building a website right now in which I use absolute positioned layers inside a relative positioned layer. The relative positioned layer, the "containing layer", has a background image, so I want this layer to stretch to the height of the other layers. I don't want to set the height of the containing layer, as the content of the other layers is dynamic. Does anyone have a solution for this problem?

Thanks,
Jiska
CookieHost is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 05-09-2007, 08:25 AM   #2 (permalink)
v7n Mentor
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 2,936
iTrader: 0 / 0%
Costin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web pro
Hello, Jiska!

Is this what you need?

Quote:
<style type="text/css">
div#PageLayout {
width: 100%;
height: auto;
background-image: url('images/backgroundImage.jpg');
background-position: top left;
background-repeat: repeat;
}
</style>

<div id="PageLayout">
........
content
........
</div>
__________________
JUNE - JavaScript Framework
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-09-2007, 08:49 AM   #3 (permalink)
Inactive
 
Join Date: 03-12-07
Posts: 17
iTrader: 0 / 0%
Latest Blog:
None

CookieHost is liked by many
Hi Costin,

Thanks for your fast reply! I tried your CSS but to bad it doesn't work in my browser (IE6). The height of the containing layer didn't change.

This is what I tried:

div.main {
position: relative;
width: 780px;
height: auto;
background-image: url(../images/bg_main.gif);
background-position: top left;
background-repeat: repeat;
margin-left: auto;
margin-right: auto;
text-align: right;
padding: 0px;
border: none;
}

Maybe something wrong here?

Thanks,
Jiska
CookieHost is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-09-2007, 01:26 PM   #4 (permalink)
v7n Mentor
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 2,936
iTrader: 0 / 0%
Costin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web pro
I've uploaded on my sub-domain a test page - go to page;

I want to let you know that IE6 displays its content in a different way than IE7.

I'm using IE7 so I don't know if this will work for you.
Visit that link with your IE6 and if everything looks ok for you than just copy the style you find on the page.

I hope that helps you
__________________
JUNE - JavaScript Framework
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-13-2007, 04:10 AM   #5 (permalink)
Inactive
 
Join Date: 03-12-07
Posts: 17
iTrader: 0 / 0%
Latest Blog:
None

CookieHost is liked by many
Hi Costin,

Thanks a lot! Your code works just fine (in IE6 as well as in IE7). I took me some time to find out why it didn't work at first. I used absolute positioned layers inside the main layer, but then the main layer doesn't stretch. It only stretches when I use some relative positioned layers as well. I uploaded an example. Is there a way to get it working with only absolute positioned layers?

Thanks,
Jiska
CookieHost is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-14-2007, 02:23 AM   #6 (permalink)
v7n Mentor
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 2,936
iTrader: 0 / 0%
Costin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web pro
Yes, there is a way: Using absolute positioning + always keep in mind the size of each
- ^^ this is not recommended

What I recommend is this:

- set the width of the page container layer ( div class="containerLayer" and in the class specify the width as follows:
Quote:
.containerLayer {
width: 800px; /* set the desired width*/
height: auto;
...
...
}
)
- use relative position for the controls inside and for spacing use the margin or the padding attribute.
- this way everything goes just fine.

Hope this ^^ make sense for you
__________________
JUNE - JavaScript Framework
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-17-2007, 07:15 AM   #7 (permalink)
Inactive
 
Join Date: 03-12-07
Posts: 17
iTrader: 0 / 0%
Latest Blog:
None

CookieHost is liked by many
Hi Costin,

Thanks again! Yes, I understand your answer but still have some problems :-) How do I get the layers next to each other if I use "position:relative" for all of them?

Thanks,
Jiska
CookieHost is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-17-2007, 10:37 AM   #8 (permalink)
v7n Mentor
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 2,936
iTrader: 0 / 0%
Costin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web pro
I suggest you use a table to separate the page content in which you can add the content.
This way you can manage the page content more easily.
__________________
JUNE - JavaScript Framework
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-17-2007, 11:25 AM   #9 (permalink)
Inactive
 
Join Date: 03-12-07
Posts: 17
iTrader: 0 / 0%
Latest Blog:
None

CookieHost is liked by many
I guess you're right :-)

Thanks,
Jiska
CookieHost is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-17-2007, 11:35 AM   #10 (permalink)
v7n Mentor
 
Costin Trifan's Avatar
 
Join Date: 04-13-07
Location: Romania
Posts: 2,936
iTrader: 0 / 0%
Costin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web proCostin Trifan is a highly respected web pro
I always do my page layout like this:

<body>
<form...>
<div id="PageManager"></div>
<div id="PageHeader">page header content: in a table or in another div</div>
<div id="PageContent">
<table....>
<tbody>
<tr>
<td class="classname">...</td>
<td class="...">...</td>
...
...
</tr>
</tbody
</table>
</div>
...
...
...and so on
</body>

I hope this example will explain better my previous post
__________________
JUNE - JavaScript Framework
Costin Trifan is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS Layer problem CookieHost Coding Forum 8 03-25-2007 10:04 AM
<div> Layer Can't see Help! :cry: donnyouyang Coding Forum 7 02-19-2005 09:18 PM
DIV layer emitind. Coding Forum 1 06-18-2004 11:29 AM
Pixel Stretch UKZJ007 Marketing Forum 0 12-30-2003 09:46 AM
Layer edges ... Atom Graphic Design Forum 33 12-16-2003 08:24 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 12:00 PM.
© Copyright 2008 V7 Inc