473,804 Members | 2,933 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

vertical extension of element

Hi

I try to build a website with a css layout. I have for example 2 div
elements with a specified width and a float-left, and the 3rd div element
has margin:0px which makes it extend to the rest of the window (or the
containing element).

Now this works well horizontally, but not vertically. Elements with
margin:0px are only as high as the text they contain. Is there a way to make
an element extend to the available height with css means (without
javascript)?

This is the same in Netscape 7 and IE 6. I use the stridt dtd.

Thanks for a hint.

Markus
Jul 20 '05 #1
4 2471
In article <3f********@new s.bluewin.ch>, Markus Ernst wrote:
Hi

I try to build a website with a css layout. I have for example 2 div
elements with a specified width and a float-left, and the 3rd div element
has margin:0px which makes it extend to the rest of the window (or the
containing element).
URL?
Now this works well horizontally, but not vertically. Elements with
margin:0px are only as high as the text they contain. Is there a way to make
an element extend to the available height with css means (without
javascript)?


Just answered something like this yesterday:
http://www.student.oulu.fi/~laurirai/www/css/#float2col

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.

Jul 20 '05 #2
In article <3f********@new s.bluewin.ch>, Markus Ernst wrote:
Hi

I try to build a website with a css layout. I have for example 2 div
elements with a specified width and a float-left, and the 3rd div element
has margin:0px which makes it extend to the rest of the window (or the
containing element).
URL?
Now this works well horizontally, but not vertically. Elements with
margin:0px are only as high as the text they contain.
Just answered something like this yesterday:
http://www.student.oulu.fi/~laurirai/www/css/#float2col
Is there a way to make an element extend to the available height
with css means (without javascript)?


Yes, positioning things absolutely. Basically, bottom:0;

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.

Jul 20 '05 #3
Thank you for your reply!
URL?
http://www.markusernst.ch/index_neu.php?rot=4&blau=1

Note that it is a mess as I am in the development process. But you can see
the point: the vertical lines in the third row, in the blue vertical column
and at the bottom of the content element have margin:0px and should extend
over the whole available space, like the version I made with absolute
positioning:
http://www.markusernst.ch/index_neu_...p?rot=4&blau=1
Just answered something like this yesterday:
http://www.student.oulu.fi/~laurirai/www/css/#float2col


This is an interesting site, I will take my time to explore it.
Is there a way to make an element extend to the available height
with css means (without javascript)?


Yes, positioning things absolutely. Basically, bottom:0;


Actually this is a try to go away from absolute positioning because this
makes some severe problems:
- bottom:0 is not interpreted by some browsers
- width:100% in the box model is treated as the window with, not the element
width (which in my oppinion is a mistake of the box model); same with
height.
- Padding and border are added to the element width according to the box
model, which triggers a scroll bar in connection with width or height:100%
(which in my oppinion is a mistake of the box model, too; the "broken" IE5
box model would be of much more convenience for every kinds of layouts)
- Netscape 7 does only print page 1 of absolute positioned elements with
long content
- Netscape 4 makes problems with transparent elements

So I think absolute positioning is not applicable for complex layouts with
lots of content, but rather for positioning special elements on a page or
for easy small layouts. That's why I try to do the same thing I did already
with absolute positioning now with floating divs (which is a nice challenge
actually).

--
Markus

Jul 20 '05 #4
In article <3f**********@n ews.bluewin.ch> , Markus Ernst wrote:
Thank you for your reply!
URL?
http://www.markusernst.ch/index_neu.php?rot=4&blau=1


Should look something like this:
http://www.markusernst.ch/index_neu_...p?rot=4&blau=1
Just answered something like this yesterday:
http://www.student.oulu.fi/~laurirai/www/css/#float2col
This is an interesting site, I will take my time to explore it.


It seems, that is almost same solution applies to your case:
#inh {border-left:1px solid #ccc;}
#kopf4 {border-right:0;}

And I didn't even need to look source code ;-)
Tested on O7. My grey is incorrect. If you have soem pages where #kopf4
is longer than #inh, use method I used in example in URL I gave earlier.
Is there a way to make an element extend to the available height
with css means (without javascript)?


Yes, positioning things absolutely. Basically, bottom:0;

Actually this is a try to go away from absolute positioning because this
makes some severe problems:
Unfortunately there is no other way to make things continue to bottom.
Fortunately that is not often actually needed, so I didn't go to details
untill URL.
- Netscape 7 does only print page 1 of absolute positioned elements with
long content
That's bad.
So I think absolute positioning is not applicable for complex layouts with
lots of content, but rather for positioning special elements on a page or
for easy small layouts. That's why I try to do the same thing I did already
with absolute positioning now with floating divs (which is a nice challenge
actually).


I think same.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.

Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
30915
by: abracad | last post by:
Hi Is it possible to vertically align an image in the middle of a DIV of fixed height?
10
66055
by: Markus Ernst | last post by:
Hi I have a strange problem with vertical-align. The case can be viewed at http://www.brainput.info/geschichte.html. HTML code: <div id="bild"><img src="geschichte.gif" width="274" height="29" alt="Wir schreiben die Geschichte Ihres Unternehmens."></div>
16
9266
by: Uncle Pirate | last post by:
This has me stumped. I am trying to use as little space as possible at the top of my document but Firefox/Mozilla insists on placing vertical space before any element. IE displays it correctly (as I want). At one point, I set some negative top margins which moved the graphics above the page in IE. Here's the link: http://abateofnm.org/ I've tried reformatting the HTML to assure there is no white space and I've tried setting top...
2
2426
by: Stanimir Stamenkov | last post by:
I'm trying to clear some sizing issues relative to the initial containing block and the root document element. The sample document I'm trying with: http://stanio.info/viewport_fill.html Basically, for some tests I want to specify the height of an example DIV element inside the BODY using percentages of the viewport height. For this to work the BODY container should fill the viewport height where I'm using:
3
2063
by: man-in-nature | last post by:
Hello, I have already read several existing posts about xsd:extension, but do not find something useful to my test case. I have one xml file and one xsd file. I can use a simple command line (C#) program to validate the xml file against the xsd file without any error. The problem is that when I validate the same xml file within VisualStudio 2003, I got five errors, which are all related to xsd:extension. It seems that those "problem"...
5
3401
by: Jeffry van de Vuurst | last post by:
Hi, I'm working on an xml schema and I'm running into some problems relating substitutionGroups and extensions. This xsd validates fine: There are three elements and three complex types and every element has the type of some complexType. <?xml version="1.0" encoding="UTF-8"?>
0
2147
by: robert | last post by:
Hi all, I'm having a hard time resolving a namespace issue in my wsdl. Here's an element that explains my question, with the full wsdl below: <definitions name="MaragatoService" targetNamespace="http://swaMaragatoNS" xmlns:tns="http://swaMaragatoNS" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
5
4827
by: Markus Ernst | last post by:
Hello This is a test example: http://www.markusernst.ch/anthracite/ http://www.markusernst.ch/anthracite/living_divani.html After googling and experimenting for several hours, I ended up doing this demo with tables. The main problems are the vertical centering of the info area, and of the text inside the squares.
40
5507
by: maya | last post by:
hi, how do I get text to vertical-align inside a div? http://www.mayacove.com/misc/home.html vertical-align should work, according to this: http://htmlhelp.com/reference/css/text/vertical-align.html
0
10568
Oralloy
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...
0
10323
jinu1996
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...
1
10311
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,...
0
9138
agi2029
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...
1
7613
isladogs
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...
0
6847
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();...
0
5516
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3813
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.