0

Hello there
I do not know what I am doing wrong but I do not get to center this site www.metatradersoftware.com completely. Although it has moved a bit to the right side since I put the wrapper, it is still staying quite on the left part of the screen. The code looks like this:

#wrap       
{ 
	  position: relative;
	  width:760px; 
          margin-left:auto;
	  margin-right:auto;
}
<body>
<div id="wrap">  
....
</div>
</body>
</html>

I would appreciate any ideas to solve this issue, because as far as I seen, this is the standar way of centering a website with css.
Look for your replies.
Thanks in advance

6
Contributors
11
Replies
12
Views
9 Years
Discussion Span
Last Post by MidiMagic
0

thats the proper way of centering.. that should work... just remove the position:relative
however, that will work for browsers like FF, Opera, etc.... but not in IE

to center divs in IE just add text-align:center;

like so:

#wrap {
text-align:center;
width:760px;
margin:auto;
}

Regards

0

shocks forgive me.... my first post was wrong...

heres the correct one...

body{text-align:center;}

#wrap {;
width:760px;
margin:auto;
}
0

use this code

#wrap       
{ 
	  position: relative;
	  width:760px; 
                 margin:0px auto;

}

Hello there
I do not know what I am doing wrong but I do not get to center this site www.metatradersoftware.com completely. Although it has moved a bit to the right side since I put the wrapper, it is still staying quite on the left part of the screen. The code looks like this:

#wrap       
{ 
	  position: relative;
	  width:760px; 
          margin-left:auto;
	  margin-right:auto;
}
<body>
<div id="wrap">  
....
</div>
</body>
</html>

I would appreciate any ideas to solve this issue, because as far as I seen, this is the standar way of centering a website with css.
Look for your replies.
Thanks in advance

0
<DIV style="position: relative;  width:760px; margin-left: 132; margin-right: 132; border: 1px solid red">
Center Text</DIV>
0

Also note that using uppercase letters in tag names is deprecated. This puts the browser into quirks mode.

0

@MidiMagic can you please give me a reference where you found uppercase tags are deprecated. actually the tag attribute should be in lowercase that is all what I know..

0

Thanks MidiMagic for the reference link. I 've visited the link and found all the HTML elements are writtenin lowercase and I do agree following this rule but I donot find that Uppercase elements are deprecated.

Thanks again

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

Note that this is not so much that the uppercase versions of tags are deprecated as it is that the new browsers are case-sensitive, and the tags are defined to be lowercase. But the effect is the same.

0

I have to agree with midimagic though I would have not used the word deprecated I would have used the word incorrect coding because xhtml does not support uppercase except for the doctype that has to be in uppercase. I would suggest going to www.w3schools.com they are a great source of information for coding!

0

Uppercase characters for tags, styles, and attributes are definitely deprecated in xhtml. But some browsers are failing to recognize some styles and attributes in html.

There is still the incompatibility between IE and other browsers that results when you put size styles (width, height) in the same tag or style that has nonzero surrounding styles (margin, border, padding). IE nexts the surrounding styles inside the sizes, the other browsers nest the sizes inside the surrounding styles.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.