15 replies [Last post]
pinehead
Offline
Regular
Last seen: 14 years 47 weeks ago
Joined: 2004-05-24
Posts: 36
Points: 0

	position: relative;
	width: 655px;
	border-top: 2px solid #000;
	border-bottom: 2px solid #000;
	margin: 10px auto;
	color: blue;
	background: #eee;
	font-weight: bold;

This make thebox centered in firefox but not ie.

whats the best way to center it in ie?

Thanks

Triumph (not verified)
Anonymous's picture
Guru

http://csscreator.com/node/19

Ed Seedhouse
Ed Seedhouse's picture
Offline
Guru
Victoria British Columbia
Last seen: 1 year 24 weeks ago
Victoria British Columbia
Timezone: GMT-8
Joined: 2005-12-14
Posts: 3570
Points: 675

There is insufficient data

There is insufficient data for a meaningful answer.

Ed Seedhouse

Posting Guidelines

Watch out! I am carrying irony, sarcasm and satire, and know how to use them.

Triumph (not verified)
Anonymous's picture
Guru

Ed Seedhouse wrote:There is

Ed Seedhouse wrote:
There is insufficient data for a meaningful answer.

Yep, but I got my money on an xml prolog. Tongue

Ed Seedhouse
Ed Seedhouse's picture
Offline
Guru
Victoria British Columbia
Last seen: 1 year 24 weeks ago
Victoria British Columbia
Timezone: GMT-8
Joined: 2005-12-14
Posts: 3570
Points: 675

How the deuce do your deduce

How the deuce do your deduce that, Sherlock?

Ed Seedhouse

Posting Guidelines

Watch out! I am carrying irony, sarcasm and satire, and know how to use them.

pinehead
Offline
Regular
Last seen: 14 years 47 weeks ago
Joined: 2004-05-24
Posts: 36
Points: 0

[code] #box { position:

[code]
#box {
position: relative;
width: 655px;
border-top: 2px solid #000;
border-bottom: 2px solid #000;
margin: 10px auto;
color: blue;
background: #eee;
font-weight: bold;

}

[\code]

This code, makes a box.
Margin: 10px auto centers the box in firefox directly center of the browser window.
However this same code makes the box in internet explorer go all the way to the left of the browser window.

I would like it to be centered inside of internet explorer and firefox.

No other code has been made on this page. If you use this exact code and you will find a box.

this is the entire txt file with the code in it!

Ed Seedhouse
Ed Seedhouse's picture
Offline
Guru
Victoria British Columbia
Last seen: 1 year 24 weeks ago
Victoria British Columbia
Timezone: GMT-8
Joined: 2005-12-14
Posts: 3570
Points: 675

pinehead wrote: #box

pinehead wrote:


#box {
position: relative;
width: 655px;
border-top: 2px solid #000;
border-bottom: 2px solid #000;
margin: 10px auto;
color: blue;
background: #eee;
font-weight: bold;}

This code, makes a box.

No it doesn't, not unless it applies to some block element in your html, and your html is valid. By itself it does nothing at all.

There is still insufficient data for a meaningful response.

I suggest you go to the forum index, read the very first message which we ask everyone to read before posting, return here and comply with it's requests. Then, when you give us what we need to help you, we may actually be able to help.

Ed Seedhouse

Posting Guidelines

Watch out! I am carrying irony, sarcasm and satire, and know how to use them.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 30 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Pinehead you must get used

Pinehead you must get used to showing all your code as this does seem to be a continual problem.

Look at this code below it creates your 'boxes' and they are centred :shrug:

So please tell us what you have done differently?

/**/

Now this 'box' does appear as it has some content! if you see the 'box above then you are viewing in IE, FF and others will collapse the 'box' leaving only the borders, they won't show something that hasn't got 'Content' - that which gives an element a purpose and therefore a reason to display. Oh and they are both centered *shrug* Please tell us that you have got a DTD on the page and that you haven't got data before that DTD such as a XML declaration?

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Triumph (not verified)
Anonymous's picture
Guru

Ed Seedhouse wrote:How the

Ed Seedhouse wrote:
How the deuce do your deduce that, Sherlock?

It's just a gamble. You in for a fiver? Tongue Laughing out loud

pinehead
Offline
Regular
Last seen: 14 years 47 weeks ago
Joined: 2004-05-24
Posts: 36
Points: 0

Take your code. View it in

Take your code.
View it in ie.
Tell me how to get the box
To be in the center of ie not to the left.

Triumph (not verified)
Anonymous's picture
Guru

pinehead wrote:Take your

pinehead wrote:
Take your code.
Check.
pinehead wrote:
View it in ie.
Done.
pinehead wrote:
Tell me how to get the box
To be in the center of ie not to the left.
You just look at it and there it is directly in the center. :shrug:

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 5 years 3 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

"Oh you mean I have to copy

"Oh you mean I have to copy all that gobbley-guck at the top of the html?"

all ยป http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 30 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

pinehead wrote:Take your

pinehead wrote:
Take your code.
View it in ie.
Tell me how to get the box
To be in the center of ie not to the left.

Pinehead please explain this response and to whom you are addressing it and what exactly the problem is that you are having; this is not a suitable comment given the code I showed you, please address posts properly with a suitable response and answer the questions raised otherwise I will have to assume that this is simply a time waste and I'll disable further comments.

Show us what code YOU HAVE that is not working the way you wish it to

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

thepineapplehead
thepineapplehead's picture
Offline
Moderator
Last seen: 15 weeks 21 hours ago
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9683
Points: 819

It's definitely either an

It's definitely either an incomplete DTD, an XML prolog, or he's using IE5 whch needs text-align: center; on the body.

Verschwindende wrote:
  • CSS doesn't make pies

J.Michael
J.Michael's picture
Offline
newbie
Columbia, MO
Last seen: 14 years 46 weeks ago
Columbia, MO
Timezone: GMT-5
Joined: 2007-09-18
Posts: 1
Points: 0

I'm having a similar problem

I'm having a similar problem here: http://216.106.58.214/

City of Columbia Office of Cultural Affairs Artists' Registry

columbia office of cultural affairs :: artists' registry















The "main" div is centered horizontally in Firefox, but not IE. What do I need to change to get the "main" div centered in IE?

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 year 22 weeks ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

Please read the stickies at

Please read the stickies at the top of each forum, in particular the ones about using a Doctype declaration (DTD). If you follow those instructions, the issue will be resolved.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.