473,503 Members | 1,681 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CSS split full screen horizontally with pixel and percent

hi all,

i have a strange problem when trying to set up a horizontal menubar:

i would like to split the whole screen from left to right into 9
pieces. the first one has a fixed width of 186px. the remaining 8
should all have the same width, depending on the screen resolution.

how can i get this to work in both IE and mozilla? i already have a
solution that works fine in mozilla, but does not in IE.

is this possible by using a table? i am currently trying to solve this
with DIVs. the problem seems to be that menubar hasn't got a width
(which is well handled by mozilla, but not by IE).

so, the menubar should start at 186px from left and then should have 8
sections all with the same width, which should fill the screen to the
very right, not caring about screen resolution.
***** HTML CODE ****

<div id="menubar">
<div id="leftframe"></div>
<div id="leftframe2"></div>
<div id="leftframe3"></div>
<div id="leftframe4"></div>
<div id="leftframe5"></div>
<div id="leftframe6"></div>
<div id="leftframe7"></div>
<div id="leftframe8"></div>
</div>
***** CSS CODE ****
#menubar
{
position: absolute;
top: 0;
left: 186px;
right: 0;
height: 30px;
z-index: 1;
background-color: #FBAE5C;
}
#leftframe
{
position: absolute;
top: 0px;
left: 0px;
width: 12.5%;
height: 100%;
z-index: 2;
background-color: #FBAE5C;
color: #F7941D;
text-align: left;
vertical-align: middle;
}

#leftframe2
{
position: absolute;
top: 0px;
left: 12.5%;
width: 12.5%;
height: 100%;
z-index: 2;
background-color: #F7941D;
text-align: left;
vertical-align: middle;
}

#leftframe3
{
position: absolute;
top: 0px;
left: 25%;
width: 12.5%;
height: 100%;
z-index: 2;
background-color: #C2BE75;
color: #AAA003;
text-align: left;
vertical-align: middle;
}

#leftframe4
{
position: absolute;
top: 0px;
left: 37.5%;
margin: 0px;
padding: 0px;
width: 12.5%;
height: 100%;
z-index: 2;
background-color: #AAA003;
text-align: left;
vertical-align: middle;
}

#leftframe5
{
position: absolute;
top: 0px;
left: 50%;
margin: 0px;
padding: 0px;
width: 12.5%;
height: 100%;
z-index: 2;
background-color: #8ACCCA;
text-align: left;
vertical-align: middle;
}
#leftframe6
{
position: absolute;
top: 0px;
left: 62.5%;
margin: 0px;
padding: 0px;
width: 12.5%;
height: 100%;
z-index: 2;
background-color: #40B9E8;
text-align: left;
vertical-align: middle;
}

#leftframe7
{
position: absolute;
top: 0px;
left: 75%;
margin: 0px;
padding: 0px;
width: 12.5%;
height: 100%;
z-index: 2;
background-color: #F69AC1;
color: #E66BA4;
text-align: left;
vertical-align: middle;
}

#leftframe8
{
position: absolute;
top: 0px;
left: 87.5%;
margin: 0px;
padding: 0px;
width: 12.5%;
height: 100%;
z-index: 2;
background-color: #E66BA4;
color: #F69AC1;
text-align: left;
vertical-align: middle;
}
any help is appreciated!
mark

Dec 8 '05 #1
6 9886
<wi****@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
hi all,

i have a strange problem when trying to set up a horizontal menubar:

i would like to split the whole screen from left to right into 9
pieces. the first one has a fixed width of 186px. the remaining 8
should all have the same width, depending on the screen resolution.

how can i get this to work in both IE and mozilla? i already have a
solution that works fine in mozilla, but does not in IE.

is this possible by using a table? i am currently trying to solve this
with DIVs. the problem seems to be that menubar hasn't got a width
(which is well handled by mozilla, but not by IE).

so, the menubar should start at 186px from left and then should have 8
sections all with the same width, which should fill the screen to the
very right, not caring about screen resolution.
***** HTML CODE ****

<div id="menubar">
<div id="leftframe"></div>
<div id="leftframe2"></div>
<div id="leftframe3"></div>
<div id="leftframe4"></div>
<div id="leftframe5"></div>
<div id="leftframe6"></div>
<div id="leftframe7"></div>
<div id="leftframe8"></div>
</div>
***** CSS CODE ****
#menubar
{
position: absolute;
top: 0;
left: 186px;
right: 0;
height: 30px;
z-index: 1;
background-color: #FBAE5C;
}
#leftframe
{
position: absolute;
top: 0px;
left: 0px;
width: 12.5%;
height: 100%;
z-index: 2;
background-color: #FBAE5C;
color: #F7941D;
text-align: left;
vertical-align: middle;
}

#leftframe2
{
position: absolute;
top: 0px;
left: 12.5%;
width: 12.5%;
height: 100%;
z-index: 2;
background-color: #F7941D;
text-align: left;
vertical-align: middle;
}

#leftframe3
{
position: absolute;
top: 0px;
left: 25%;
width: 12.5%;
height: 100%;
z-index: 2;
background-color: #C2BE75;
color: #AAA003;
text-align: left;
vertical-align: middle;
}

#leftframe4
{
position: absolute;
top: 0px;
left: 37.5%;
margin: 0px;
padding: 0px;
width: 12.5%;
height: 100%;
z-index: 2;
background-color: #AAA003;
text-align: left;
vertical-align: middle;
}

#leftframe5
{
position: absolute;
top: 0px;
left: 50%;
margin: 0px;
padding: 0px;
width: 12.5%;
height: 100%;
z-index: 2;
background-color: #8ACCCA;
text-align: left;
vertical-align: middle;
}
#leftframe6
{
position: absolute;
top: 0px;
left: 62.5%;
margin: 0px;
padding: 0px;
width: 12.5%;
height: 100%;
z-index: 2;
background-color: #40B9E8;
text-align: left;
vertical-align: middle;
}

#leftframe7
{
position: absolute;
top: 0px;
left: 75%;
margin: 0px;
padding: 0px;
width: 12.5%;
height: 100%;
z-index: 2;
background-color: #F69AC1;
color: #E66BA4;
text-align: left;
vertical-align: middle;
}

#leftframe8
{
position: absolute;
top: 0px;
left: 87.5%;
margin: 0px;
padding: 0px;
width: 12.5%;
height: 100%;
z-index: 2;
background-color: #E66BA4;
color: #F69AC1;
text-align: left;
vertical-align: middle;
}
any help is appreciated!
mark


Suggest you give menubar a width of 100%. All div's will then be visible in
IE6.
Dec 8 '05 #2
thanks for you reply, but that doesn't solve the problem. i need to
give a width of 186px to the first DIV. all other DIVs need to be of
the same width from 186px to the very right of the browser window.

Dec 8 '05 #3
sorry, forgot to mention: when i give menubar a width of 100%, i need
to scroll to the very right as the window is then 186px to large.

menubar is a child of the body. body is defined as:

body
{
position: absolute;
margin: 0;
padding: 0;
left: 0px;
top: 0px;
right: 0px;
bottom: 0px;
}

Dec 8 '05 #4
"Mark Wiewel" <wi****@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
thanks for you reply, but that doesn't solve the problem. i need to
give a width of 186px to the first DIV. all other DIVs need to be of
the same width from 186px to the very right of the browser window.


Your code indicates that menubar is 186px from the left but has no width.
The width of all other divs is 12.5% (percent of what?). I must be
misunderstanding you. Do you want menubar to be 186px from the left and all
other divs (except menubar) to be 186px wide? That would be a total width of
1488px for 8 divs. If so then horizontal scrolling will surely be required
to view all 8 divs. I'm confused.
Dec 8 '05 #5
sorry for the confusion, but my english isn't that well:

i would like to have:

column1: width 186px;
column2: width 12.5 % OF THE REST
column3: width 12.5 % OF THE REST
....
....
column9: width 12.5 % OF THE REST

OF THE REST means screenwidth - 186px

does this help?

cheers, mark

Dec 9 '05 #6
Try this in the html

<div class="fixedColumn" id="column1">
</div>
<div id="otherColumns>
<div class="anotherColumn" id="column2"></div>
...
<div class="anotherColumn" id="column9"></div>
</div>

then experiment a bit with the css to make it work.

--
Martin Eyles
ma**********@NOSPAM.bytronic.com

"Mark Wiewel" <wi****@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
sorry for the confusion, but my english isn't that well:

i would like to have:

column1: width 186px;
column2: width 12.5 % OF THE REST
column3: width 12.5 % OF THE REST
...
...
column9: width 12.5 % OF THE REST

OF THE REST means screenwidth - 186px

does this help?

cheers, mark

Dec 13 '05 #7

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

Similar topics

14
2763
by: eric | last post by:
I am attempting to create <A HREF> links to <A NAME> targets in a series of extremely wide web pages composed of tables with text and images sitting side by side. This is a failure since both...
2
14129
by: Marek Mänd | last post by:
Can the legend element in fieldset be placed automatically by Mozilla horizontally in the middle of fieldset?
4
8193
by: grogerteal | last post by:
Hello, I am pretty new to programming and would like someone to help me get started on the program that I need to make. I hope it is not hard to do, but what I would like is a simple app that...
2
1885
by: Maryam | last post by:
Is a split window possible for an MS DOS program and MS Access program?? If so how??? When you run a DOS programn it covers the whole of the PC screen and if you have other applications you...
6
13795
by: zhimin | last post by:
Hi! How to set a form full screen, the title bar, close button, and system task bar should hide while the form run. Like some game software such as Empero Era, Brood, Quake and so on. Thanks!
6
4700
by: Hooyoo | last post by:
I want to get the color of the specified pixel in the screen. Firstly I get the position of the cursor: //Get the position of cursor. Point position = Cursor.Position; Next I want to get the...
2
2855
by: ahammad | last post by:
Hello, I used the Doc/View architecture to create a split screen application. On startup, the screen is already split horizontally. I did the following in the MainFrm class: BOOL...
23
3344
by: salmobytes | last post by:
I try to do all css with percents and ems (elastic/liquid) so my displays look as much the same as possible, regardless the user's screen resolution. But I (still) never seem to get what I want. ...
4
3555
by: cjstuttle | last post by:
Could anyone help me, I'm a python noob and need some help. im trying to find some code that will, given a screen co-ordinate, will give me the colour of that pixel in RGB. i have found a lot about...
0
7202
marktang
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,...
0
7328
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...
0
7458
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5013
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...
0
4672
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...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.