Results 1 to 10 of 10

Thread: Trying to Center Div In Opera

  1. #1
    Join Date
    Feb 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Trying to Center Div In Opera

    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/

  2. #2
    Join Date
    Nov 2006
    Posts
    236
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    you need to post your css on the div or whatever it is your are having problems with.

  3. #3
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    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:

    Code:
    margin:0 auto;
    or adding the following to it's parent div:

    Code:
    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.

  4. #4
    Join Date
    Nov 2006
    Posts
    236
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    I don't think that site adds the extra head an style tags. I've got a site there and never saw that happen.

  5. #5
    Join Date
    Feb 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  6. #6
    Join Date
    Feb 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I think it does, but only because it has asvertisements because I have the free version.

  7. #7
    Join Date
    Feb 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I though you could see it when you checked the website and went to View>Source because it's an internal stylesheet ?

  8. #8
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Quote Originally Posted by Medyman View Post
    or adding the following to it's parent div:
    Code:
    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:
    Code:
    <!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.
    Jeremy | jfein.net

  9. #9
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    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.

  10. #10
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    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.
    Jeremy | jfein.net

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •