www.webdeveloper.com
Results 1 to 8 of 8

Thread: Trying to center comment buttons in Internet Explorer

  1. #1
    Join Date
    Feb 2003
    Posts
    138

    Trying to center comment buttons in Internet Explorer

    hi,

    I finally have my comments page working but the "Post" and "Refresh" buttons are not centering in Internet Explorer. In Mozilla they are fine. I tried specifying the position using "margin:" in the external css file using an IE hack but I'm not sure where the buttons are in the shoutbox.php page code.

    does anyone know of a way i can get the "Post" and "Refresh" buttons under the text box as it is in mozilla?
    click here to see page
    thank you

  2. #2
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    Without a doctype IE will never match up with web browsers.
    "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan

  3. #3
    Join Date
    Feb 2003
    Posts
    138
    so you're saying I should take the doc type from my regular website pages and put in my comment page code?

  4. #4
    Join Date
    Feb 2003
    Posts
    138
    Okay, I specified a doc type for my shoutbox page but the problem is most of the code for the page is so unintelligible (im new to Mysql), when I try to use an IE hack, I don't know where to put the identifier because I don't know where the buttons (that's what I'm trying to position) begin or end in the code.

    The doc type is obviously a start but I'm afraid I will need a little more help in positioning the buttons. Can anyone advise me further on this? Thank you.

    Mike

  5. #5
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    Well, the doctype needs to be the first line. It's the second. And there's a lot of nonsense in there like float:center and that first visible line should be an h1, not a div and none of the breaks are needed.

    The bottom line is start here.
    http://validator.w3.org/check?verbos...2Fshoutbox.php
    "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan

  6. #6
    Join Date
    Dec 2005
    Location
    American, living in Toronto, ON. CANADA
    Posts
    6,746
    I put lil' wedges and tweaks throughout this, imported your external CSS and comment-out the external, got it centered and everything more-or-less lines up.

    There are repeated deprecated tags that I started to removed, but it was causing problems so I re-installed what you had. There are quite a few "id" 's being used over, when they should be "class" 'es. I re-did those, and got unpleasing results, so I put them back...

    I put in a strict !doctype first of all (hence, causing these errors), but it works like I said, more-or-less 'centered' on IE and Firefox, -so we've gained some ground.

    I might tweak it more, later...
    Attached Files Attached Files

  7. #7
    Join Date
    Aug 2006
    Posts
    57
    right after the text-box code put <br> and maybe it will move under the text-box.
    and if your wanting it centered, u could use <div align="center, or left, or right">
    then
    </div>

  8. #8
    Join Date
    Dec 2005
    Location
    American, living in Toronto, ON. CANADA
    Posts
    6,746
    Quote Originally Posted by JavaKid93
    right after the text-box code put <br> and maybe it will move under the text-box.
    and if your wanting it centered, u could use <div align="center, or left, or right">
    then
    </div>
    You know, -that might actually work. Right now I merely have the button-containing element with a postion:relative; left:somethingpx; because I assume that this width will never change. This should be centered, not positioned., to keep it 'fluid'..

    What I did will display differently in IE vs. Firefox, as Firefox isn't showing a vertical scrollbar unless one is needed. IE just shows it. I'm 'centering' based upon the presence of a vert. scrollbar, so there's about a 20-pixel discrepancy between the two when 'visually' inspected.

    I should have posted the main problem I fixed (so that we all could understand this), -I forgot what I did, but it seems as if there was a "float:left;" in the CSS somewhere that was a major tripping factor. I commented it out and things started behaving better... Might be that this is why the buttons were 'to the left' and removing that freed-up the element and alowed me to 'position' it nicely even though it seemed stubborn and would not 'center' for me any other way..

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles