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:
  #16  
Old June 13th, 2003, 06:05 PM
ROT ROT is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 41 ROT User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 35 sec
Reputation Power: 9
im sure what jharnois posted will work -- even if it's not what you're looking for (at least, from what i get out of your post)

but, why would you want to use margins to center something? when the text-align would work better.

Reply With Quote
  #17  
Old June 13th, 2003, 06:37 PM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,344 jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 6 h 26 m 32 sec
Reputation Power: 787
B/c using margins is the correct method for centering a block element such as a <div> while text-align should be used for inline elements. You have to do it in IE b/c it doesn't conform to the standards correctly -- it's simply a workaround.

Reply With Quote
  #18  
Old June 13th, 2003, 07:24 PM
DrWorm's Avatar
DrWorm DrWorm is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2002
Location: Queensland, Australia
Posts: 587 DrWorm User rank is Sergeant Major (2000 - 5000 Reputation Level)DrWorm User rank is Sergeant Major (2000 - 5000 Reputation Level)DrWorm User rank is Sergeant Major (2000 - 5000 Reputation Level)DrWorm User rank is Sergeant Major (2000 - 5000 Reputation Level)DrWorm User rank is Sergeant Major (2000 - 5000 Reputation Level)DrWorm User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 11 h 36 m 51 sec
Reputation Power: 40
Unfortunately I can't use text-align : centre as content-area encloses a lot of other HTML for the page. I've just stripped it down here to show what isn't working.

Quote:
Yes, IE does not support the margin: auto; property correctly.


But IE 6 does. I've read that it does everywhere and have seen it work for myself. But my page is the only page where I have seen it not work. Which leads me to belive that I must be doing something incorrectly.

Is it possible headers could make a difference since we seem to agree that the code I've shown should work?
__________________
Ooh, they have the Internet on computers now!

Reply With Quote
  #19  
Old June 13th, 2003, 07:47 PM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,344 jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 6 h 26 m 32 sec
Reputation Power: 787
Since you've stripped it down to relevant code it's hard for us to know wether or not anything else is affecting it. It is still possible to use the workaround by adding yet another <div> to the collection. Cross-browser compatibility is such a pain isn't it.
Code:
<div>
  <div style="width:100%;text-align:center">
    <div style="width:50%;margin-left:auto;margin-right:auto">Center Me</div>
  </div>
  This text should not be centered.
</div>

Reply With Quote
  #20  
Old June 15th, 2003, 07:00 PM
DrWorm's Avatar
DrWorm DrWorm is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2002
Location: Queensland, Australia
Posts: 587 DrWorm User rank is Sergeant Major (2000 - 5000 Reputation Level)DrWorm User rank is Sergeant Major (2000 - 5000 Reputation Level)DrWorm User rank is Sergeant Major (2000 - 5000 Reputation Level)DrWorm User rank is Sergeant Major (2000 - 5000 Reputation Level)DrWorm User rank is Sergeant Major (2000 - 5000 Reputation Level)DrWorm User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 11 h 36 m 51 sec
Reputation Power: 40
Thanks for the suggestion jharnois.

This is the only piece of code I left out from my earlier post...

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />


I would be interested to hear if this code works for anyone using IE6.

Reply With Quote
  #21  
Old June 18th, 2003, 07:21 PM
DrWorm's Avatar
DrWorm DrWorm is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2002
Location: Queensland, Australia
Posts: 587 DrWorm User rank is Sergeant Major (2000 - 5000 Reputation Level)DrWorm User rank is Sergeant Major (2000 - 5000 Reputation Level)DrWorm User rank is Sergeant Major (2000 - 5000 Reputation Level)DrWorm User rank is Sergeant Major (2000 - 5000 Reputation Level)DrWorm User rank is Sergeant Major (2000 - 5000 Reputation Level)DrWorm User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 11 h 36 m 51 sec
Reputation Power: 40
FOUND IT!!!

I don't know why I didn't copy this bit of code into my previous post but DW automatically puts this line at the top of a XHTML compliant page...
Code:
<?xml version="1.0" encoding="iso-8859-1"?>


I removed the line and "margin : auto" now works as it should. Booyah! I'm not sure what the intended function of this line is but without it the named CSS fonts sizes (ie. small, x-large) are all one size smaller.

Reply With Quote
  #22  
Old June 18th, 2003, 07:29 PM
ROT ROT is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 41 ROT User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 35 sec
Reputation Power: 9
for a code editor - i recommend editplus - colors your code and you dont have to worry about extra lines you didnt put in the file

Reply With Quote
  #23  
Old June 19th, 2003, 08:59 AM
icy_polecat's Avatar
icy_polecat icy_polecat is offline
Senior Polecat
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Jersey (the original version)
Posts: 210 icy_polecat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 59 m 57 sec
Reputation Power: 6
Send a message via Yahoo to icy_polecat
aah ... that explains it. I've also had trouble with the XML declaration before (it drove me nuts with typeface sizing!) and it would seem that there are a number of IE specific bugs related to the inclusion of XML decs.

And before any body gets on their high horse about "bloomin editors inserting their own code ... blah ... blah" it is worth bearing in mind that - according to W3C recomendations, all web pages using an encoding other than UTF-8 or UTF-16 should include the XML Declaration:

http://www.w3.org/TR/xhtml1/#strict

You can omit the line of course and specify your encoding using the meta tag:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

which dreamweaver also includes automatically. It seems that the guys at Macromedia are trying to cover the asses in terms of how best to specify encoding... but I hasten to add that it isn't their fault that IE doesn't correctly render page elements and styles when the XML is included - Microsoft did that all on their own!

Icy
__________________
Quidquid latine dictum sit, altum viditur.

http://www.XSet.co.uk

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > css and table alignment


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 1 hosted by Hostway