CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 22nd, 2004, 11:03 PM
lambrite lambrite is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 52 lambrite User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 50 m 28 sec
Reputation Power: 5
3 questions - centering and extending, and margins

I guess let me start with centering. I have
Code:
body {
	margin: 1%;
	font-family:Verdana, Arial, Helvetica, sans-serif;
	font-size: 10pt;
	line-height: 1.75em;
	background-color: #6E4E1C;
  	text-align: center;
}
#wrapper {
	background-color: #343457;
	width: 775px;
	position:absolute;
	margin: 0px auto;
	text-align: left;


By everything I read, setting the body's text-align to center, and the wrapper's margins to auto should do the trick. When I copy other stylesheets, they work. But when I type it in, it doesn't? Mozilla puts content at the left, and IE6 puts the left border of the wrapper in the center of the page causing horizontal scroll.
(actual pages at http://lgs.lambrite.com/new.css and http://lgs.lambrite.com/test2.htm

2nd, if you visit the htm page above you see that my content div does not extend down to meet the footer. I have looked at the faux columns, but can't make that work and keep my blue border at the bottom, unless I add another wrapper div to hold the background, inside of the primary wrapper div. This seems not the best way to do this. Any suggestions?

Lastly, in Mozilla, the url background on my sublinks nicely meets the content background, but in IE, there is a nice empty blue space between them I understand that this probably has to do with the box model issues, but have no idea how to fix it.

I'd also welcome any criticism on my stylesheet (aside from the fact that it is not in short-hand - I am not familiar enough yet).

You guys are great for newcomers - I know I really appreciate the help!

Sarah

Reply With Quote
  #2  
Old June 23rd, 2004, 01:02 AM
1beb's Avatar
1beb 1beb is offline
This tagline is not long enoug
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2003
Location: Toronto, ON Canada! I AM CANADIAN
Posts: 861 1beb User rank is Corporal (100 - 500 Reputation Level)1beb User rank is Corporal (100 - 500 Reputation Level)1beb User rank is Corporal (100 - 500 Reputation Level)1beb User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 h 32 m 12 sec
Reputation Power: 10
Send a message via ICQ to 1beb Send a message via AIM to 1beb Send a message via MSN to 1beb Send a message via Yahoo to 1beb
You need to change the wrapper to have text-align:center; not text-align:left;...

Other than that you've set the width for #wrapper, twice, meaning that the first setting is redundant, it doesn't do anything...

html, body, #wrapper{width:98%; /* remove me */}

Also, there is no need to even bother with setting the position:absolute; attribute on #wrapper

If you want a simple a clean example of a page that is centered with the use of one of IE's innappropriate CSS rules, please see http://bluerobot.com/web/css/center1.html
and http://bluerobot.com/web/css/center2.html

Reply With Quote
  #3  
Old June 23rd, 2004, 01:17 AM
1beb's Avatar
1beb 1beb is offline
This tagline is not long enoug
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2003
Location: Toronto, ON Canada! I AM CANADIAN
Posts: 861 1beb User rank is Corporal (100 - 500 Reputation Level)1beb User rank is Corporal (100 - 500 Reputation Level)1beb User rank is Corporal (100 - 500 Reputation Level)1beb User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 h 32 m 12 sec
Reputation Power: 10
Send a message via ICQ to 1beb Send a message via AIM to 1beb Send a message via MSN to 1beb Send a message via Yahoo to 1beb
just so you know for next time... margin: 'top' 'right' 'bottom' 'left'; where top,left,bottom, and right can be in %, em,or px

another suggestion is regarding your predicament with the main text not extending to the footer. You have to decide wether or not you want it to be an overflow, or just a page that scrolls ( scrolling normally, is the most intuitive approach from a useability perspective)

Reply With Quote
  #4  
Old June 24th, 2004, 12:24 AM
lambrite lambrite is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 52 lambrite User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 50 m 28 sec
Reputation Power: 5
The position:absolute is necessary for the footer to appear at the bottom of the page. It appears that this is also my issue with centering - when the position is relative, the page centers (but the footer shoves up over my content). The second footer example used ablsolute positioning and (mostly) worked like a charm. Thanks!

I think the content should be overflow? I don't want the scroll to occur in the content div, but in the browser window...

Reply With Quote
  #5  
Old June 24th, 2004, 12:32 AM
1beb's Avatar
1beb 1beb is offline
This tagline is not long enoug
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2003
Location: Toronto, ON Canada! I AM CANADIAN
Posts: 861 1beb User rank is Corporal (100 - 500 Reputation Level)1beb User rank is Corporal (100 - 500 Reputation Level)1beb User rank is Corporal (100 - 500 Reputation Level)1beb User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 h 32 m 12 sec
Reputation Power: 10
Send a message via ICQ to 1beb Send a message via AIM to 1beb Send a message via MSN to 1beb Send a message via Yahoo to 1beb
Quote:
Originally Posted by lambrite
The position:absolute is necessary for the footer to appear at the bottom of the page. It appears that this is also my issue with centering - when the position is relative, the page centers (but the footer shoves up over my content). The second footer example used ablsolute positioning and (mostly) worked like a charm. Thanks!


Ah, I see, I didn't realize that was what you were using it for. What browsers are you aiming for this to work completely on?

Quote:
Originally Posted by lambrite
I think the content should be overflow? I don't want the scroll to occur in the content div, but in the browser window...


If the content was set as overflow you would see an interstitial scroll bar, meaning not what you want with respect to this stament.

However, if you use absolute positioning to physically place the footer it will be a problem. The reason being is that the content div will never stretch to the footer, the footer should come up to meet the content div... It's actually the opposite of what you want. Well, at least assuming you want the footer to dynamically move up/down as content is added.

Another option would be making the footer relative to the containing div, and making the content div relative to it's container. This would allow you to create a specified height for the content div to force the footer down. Should your content overflow this height it will simply flow down more and push the footer down respectively.

Reply With Quote
  #6  
Old June 24th, 2004, 11:55 PM
kk5st's Avatar
kk5st kk5st is offline
Thanks Johnny Hart (BC) R.I.P.
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: May 2003
Location: Dallas
Posts: 4,659 kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Month 3 Days 11 h 50 m 18 sec
Reputation Power: 687
Whew! I was trying to figure this out but not having a lot of luck. There's nothing seriously wrong, just little things that pile up. What I did was whack it back to the basic footer demo code and add the elements in one at a time.

The css was simplified. The html was simplified and should be valid xhtml 1. I simplified the javascript for the menu. BTW, that submenu is shhweet.

Centering is fixed.

The content stretching to the footer is sleight of hand.

The 'tab' effect on the submenu is fixed. I don't know how, it just happened as I rebuilt the page. You may spot the difference(s). It may be from using static rather than absolute positioning.

cheers,

gary
Attached Files
File Type: txt lgs2.css.txt (3.2 KB, 214 views)
File Type: txt lgs2.html.txt (4.9 KB, 275 views)
__________________
There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing.

My html and css workshop, demos and tutorials.
Ask a better question, get a better answer.

Reply With Quote
  #7  
Old June 25th, 2004, 07:28 AM
kk5st's Avatar
kk5st kk5st is offline
Thanks Johnny Hart (BC) R.I.P.
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: May 2003
Location: Dallas
Posts: 4,659 kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Month 3 Days 11 h 50 m 18 sec
Reputation Power: 687
I reworked part of the css to hack an IE bug.
Code:
#footer img {
    position: relative;
    width: 34px;
    float: right;
    margin-right: 2em;
    margin-top: -35px;
    }

/* IE had a brain-fart with negative margin-top
 * so I left it alone in IE and put it back for
 * modern browsers, using the child selector.
 */

/* OK, another work-around.  IE doesn't display
 * the part of a float element 'pulled' beyond 
 * the container.  Big John found that making
 * the float element {position:relative;} fixes the
 * problem.  This is an IE bug, pure and simple.
 /*
/*
#footer>img {
    margin-top: -35px;
    }
*/
Life would be so much better without IE

cheers,

gary

Reply With Quote
  #8  
Old June 26th, 2004, 05:41 PM
lambrite lambrite is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 52 lambrite User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 50 m 28 sec
Reputation Power: 5
Life would be so much better without IE

You won't hear any arguments from me.

Thanks a ton for looking at this! I had figured everything out except for the stretching background, but I was getting as lost as you with what was what and why it was there. Parlty that's b/c I copy and paste and tweak what works, without necessarily understanding what is going on.

I'm about to print everything out and really study what you did.

(very grateful)
Sarah

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > 3 questions - centering and extending, and margins


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT