Computer Webmaster Gaming Console Graphics Forum

Welcome to the Computer Webmaster Gaming Console Graphics Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

MK PitStop Main Earn $25 Earn Money Posting Extras Members Blogs Image Hosting User Pages
Go Back   Computer Webmaster Gaming Console Graphics Forum > Webmaster Forum > Website Coding > HTML
Register FAQ/Rules Become A V.I.P. Member Search Today's Posts Mark Forums Read

HTML HTML problems, maybe you are trying to code for MySpace. Get all the HTML coding help here for your website.

Google
Closed Thread
 
LinkBack Thread Tools Display Modes
Old 07-01-2007, 1:47 PM   #1
David Graham
 
David Graham's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default CSS positioning help - Mozilla


"Lorne Cameron" <lcameron@cis.strath.ac.uk> wrote in message
news:3efda4d2@nntphost.cis.strath.ac.uk...
> I've been trying to change my site's layout to CSS, but I've run into
> some trouble. The layout is a header image, 760x115, then a menu image
> on the left below that, 160x439, and then the main content in the
> remaining space. Here's what I have just now (borders are in place so
> that I can see what's happening):
>
>
> <HTML>
> <HEAD>
> <TITLE>Test</TITLE>
> </HEAD>
>
> <BODY>
> <div style="border: solid red;">
> <IMG SRC="images/header_large.gif" ALT="header.gif">
> </div>
>
> <div style="position:absolute; top:0px; padding-left:0px;
> padding-top:115px; height:439px; width:160px; border: solid green;">
> <IMG SRC="images/menu.gif" ALT="menu.gif">
> </div>
>
> <div style="position:absolute; top:0px; padding-left:160px;
> padding-top:115px; height:100%; width:100%; text-align:center;
> border:solid blue;">
> TESTING
> </div>
> </BODY>
> </HTML>
>
>
> It looks great in IE6, but in Mozilla it seems as if the padding-left
> and padding-top aren't taken into account when sizing the third DIV at
> 100% (I want this DIV's dimensions to be 100% so that
> vertical-align:middle and text-align:center will be correct relative to
> the whole window), and so the DIV's height is actually (100% + 115px)
> and width is (100% + 160px), so scrollbars are present. I've played
> around with padding and margins and can't find a solution to get what
> I'm looking for. Can anyone help me out?
>
> Thanks.
> LC.



----- Original Message -----
From: "Lorne Cameron" <lcameron@cis.strath.ac.uk>
Newsgroups: alt.html
Sent: Saturday, June 28, 2003 3:23 PM
Subject: CSS positioning help - Mozilla


> I've been trying to change my site's layout to CSS, but I've run into
> some trouble. The layout is a header image, 760x115, then a menu image
> on the left below that, 160x439, and then the main content in the
> remaining space. Here's what I have just now (borders are in place so
> that I can see what's happening):
>
>
> <HTML>
> <HEAD>
> <TITLE>Test</TITLE>
> </HEAD>
>
> <BODY>
> <div style="border: solid red;">
> <IMG SRC="images/header_large.gif" ALT="header.gif">
> </div>
>
> <div style="position:absolute; top:0px; padding-left:0px;
> padding-top:115px; height:439px; width:160px; border: solid green;">
> <IMG SRC="images/menu.gif" ALT="menu.gif">
> </div>
>
> <div style="position:absolute; top:0px; padding-left:160px;
> padding-top:115px; height:100%; width:100%; text-align:center;
> border:solid blue;">
> TESTING
> </div>
> </BODY>
> </HTML>
>
>
> It looks great in IE6, but in Mozilla it seems as if the padding-left
> and padding-top aren't taken into account when sizing the third DIV at
> 100% (I want this DIV's dimensions to be 100% so that
> vertical-align:middle and text-align:center will be correct relative to
> the whole window), and so the DIV's height is actually (100% + 115px)
> and width is (100% + 160px), so scrollbars are present. I've played
> around with padding and margins and can't find a solution to get what
> I'm looking for. Can anyone help me out?
>
> Thanks.
> LC.

Hi
I'm no expert but this sounds to me like you have run into the broken box
model thing. Basically, Netscape does it correctly and adds on the border
width and padding width to the content width (reason for the 100% div being
too wide/high) and IE in quirks mode does not (you have no DTD so your in
quirks mode
I would absolutely position the main div with a top: 115px; left: 160px
so you don't need the padding, that way Netscape will look the same as the
quirky IE. Mind you, you should not be using IE in quirk mode, better to
write code for a standard compliant IE instead. There is a hack which you
can use which basically, lets a broken IE see the wrong width and Netscape
and IE6 (standard mode) see the correct width (which becomes the same size
as the bigger incorrect width after padding and borders are added on.

I have used the hack here
#navigation,#navigationcp {
width: 200px;
z-index: 50;
position: relative;
top: 0px;
left: 0px;
float: left;
padding-left: 10px;
padding-right: 10px;
padding-top: 10px;
padding-bottom: 75px;
margin-bottom: 0px;
height: auto;
background-color: #f74902;
color: #000000;
voice-family: "\"}\"";
voice-family: inherit;
width: 180px;
}


all browsers get a width of 200px. The incorrect browsers read the bit above
the voice-family: "\"}\""; and put all the padding within the content width
of 200px, so it doesn't get any bigger than 200px, the good browsers can
read past the voice-family: "\"}\""; bit so get 180px but then they add the
padding onto this which brings you back to 200px.

HTH (I might have made some terrible errors here but its fun helping,
couldn't help myself. Others will be along to put you right

bye
David



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 07-01-2007, 1:47 PM   #2
Lorne Cameron
 
Lorne Cameron's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default CSS positioning help - Mozilla

David Graham wrote:
> [SNIP]
> I would absolutely position the main div with a top: 115px; left: 160px
> so you don't need the padding



IF you mean setting top:115px;left:160px; and ditching the
height/width:100%; then yes, I've considered that (in fact, I think that
was my original implementation), but that will lead to the main DIV
being only as wide as is necessary to fit in the content, as opposed to
the width of the remaining window space. Say the only content in the
main DIV was a 200x200 pixel image - even when centered in the DIV, it
would not be centered on the screen.

So, as I see it my options now are:

1) Set a constant pixel width for the main DIV. Problem: won't look
good at very high/low resolutions - I'll need to find a compromise for a
width to choose.

2) Use javascript to find out window width then set main DIV width as
(window_width - 160). Worth the hassle?

3) ?? Is there simple solution with CSS that I don't know about? Any
input would be much appreciated.

LC.

 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Featured Websites
Free Space
Free Space
Free Space Free Space
Closed Thread
Tags: , , ,




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 positioning vs. tables PeterMcC HTML 0 07-01-2007 1:22 PM
UK Positioning Problem / TrakM8 John P GPS 1 06-12-2007 5:20 PM
The Death of Positioning? Advanced Web Technologies Building An Internet Business 0 05-29-2007 1:44 AM
banning this browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) no.reply7@comcast.net Website Reviews And Website Questions 13 05-28-2007 12:42 AM


Featured Websites




All times are GMT +1. The time now is 6:26 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Cheap Computers
MK PitStop Copyright 2005 - 2008

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 86 87 88 89 90 91 92 93 94 95 96 97 98