View Full Version : Trying to Center Div In Opera
Wires
08-22-2008, 04:14 AM
Well, I've tried everything I possibly can to get this to work. I've managed to get this to center in FF and IE, however, I just cannot get it to center in Opera. Any help would be appreciated.
This is the site: (ignore the babble code that Bravenet inserts please, that is not the issue.)
http://provi.bravehost.com/
riptide
08-22-2008, 12:39 PM
you need to post your css on the div or whatever it is your are having problems with.
Medyman
08-22-2008, 01:15 PM
Which part are you trying to align? I don't see a difference between Opera and Fx 3.0.
If it's div#content, try adding this to it's styling:
margin:0 auto;
or adding the following to it's parent div:
text-align:center;
By the way, I'm not sure if this is the "babble code that Bravenet inserts" or not, but you do realize you have two DTDs, <head>, and <style> sections, right? There should be a way around this.
riptide
08-22-2008, 02:47 PM
I don't think that site adds the extra head an style tags. I've got a site there and never saw that happen.
Wires
08-22-2008, 09:42 PM
I do realize there are two DTD's, which was part of the Babble Code. I did try what you said before, about margin and auto, but I'll try it again.
Wires
08-22-2008, 09:44 PM
I think it does, but only because it has asvertisements because I have the free version.
Wires
08-22-2008, 09:45 PM
I though you could see it when you checked the website and went to View>Source because it's an internal stylesheet ?
or adding the following to it's parent div:
text-align:center;
Actually from my knowledge, this will not work, looking at it, it says "text" witch to me, seems like it may mean text or images. Not "divs", but will apply to text inside the child divs, for example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Centered text. Not div</title>
<style type="text/css">
#parentDiv {
width: 70%;
height: 100px;
border: 1px solid #000;
background: #D6FFD8;
padding: 20px;
text-align: center;
}
.inside {
height: 70px;
width: 70px;
border: 1px solid #000;
background: #FFFFF4;
</style>
</head>
<body>
<p>Below, shows a big box, with a little box inside that is not centered, but inside of the little box, has text. And that <b>is</b> centered.</p>
<div id="parentDiv">I'm centered!<div class="inside">Same!</div></div>
</body>
</html>
Will show one box that spreads across the page, and another one that is only 70 * 70px, it has the text-align centered property, but only the text inside the child div, and parent div are centered. Not the parent div itself.
Medyman
08-22-2008, 11:14 PM
Actually from my knowledge, this will not work, looking at it, it says "text" witch to me, seems like it may mean text or images. Not "divs", but will apply to text inside the child divs, for example:
It does in IE. In my experience, I've find Opera to be closer to IE than to Firefox or Safari. That's why I suggested that since the original question was about Opera. Of course, I didn't test it so I could be wrong in my assumption.
I see, the reason I spoke up was because I was specifically talking about Safari and FireFox, not knowing it Opera had this feature. If it does, of course.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.