Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Firefox ignoring positioning parts of CSS

Firefox ignoring positioning parts of CSS

Scheduled Pinned Locked Moved Web Development
phpcssdatabasequestionlearning
12 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 4 Offline
    4 Offline
    47_MasoN_47
    wrote on last edited by
    #1

    Alright I have a .php document that lists the results from a query into a table, and has some controls above the table that allow me to make changes to entries if something isn't quite right. Here is the CSS:

    body {
    background-color: #cccccc;
    }

    #changeStatus {
    font-family: arial, helvetica, sans-serif;
    font-size: 0.6em;
    position: absolute;
    left: 2em;
    top: -10em;
    }

    #changeUser {
    font-family: arial, helvetica, sans-serif;
    font-size: 0.6em;
    position: absolute;
    left: 28em;
    top: -10em;
    }

    #changeRequired {
    font-family: arial, helvetica, sans-serif;
    font-size: 0.6em;
    position: absolute;
    left: 55em;
    top: -10em;
    }

    #changeRequested {
    font-family: arial, helvetica, sans-serif;
    font-size: 0.6em;
    position: absolute;
    left: 86em;
    top: -10em;
    }

    #itlisttableadmin {
    font-family: arial, helvetica, sans-serif;
    font-size: 0.8em;
    position: absolute;
    left: 0em;
    top: 8em;
    }

    th {
    font-family: arial, helvetica, sans-serif;
    font-size: 0.8em;
    color: maroon;
    }

    td {
    font-family: arial, helvetica, sans-serif;
    font-size: 0.8em;
    }

    IE of course garbles it up just because it's IE, but it works just fine in Opera. Everything looks exactly how it should. When I open the page in Firefox, the font-family and font-size for the #change sections work fine, but the positioning doesn't. All the other parts of the CSS work. Can someone tell me what I'm doing wrong? The CSS statement is called in the PHP like this echo "";.

    G 1 Reply Last reply
    0
    • 4 47_MasoN_47

      Alright I have a .php document that lists the results from a query into a table, and has some controls above the table that allow me to make changes to entries if something isn't quite right. Here is the CSS:

      body {
      background-color: #cccccc;
      }

      #changeStatus {
      font-family: arial, helvetica, sans-serif;
      font-size: 0.6em;
      position: absolute;
      left: 2em;
      top: -10em;
      }

      #changeUser {
      font-family: arial, helvetica, sans-serif;
      font-size: 0.6em;
      position: absolute;
      left: 28em;
      top: -10em;
      }

      #changeRequired {
      font-family: arial, helvetica, sans-serif;
      font-size: 0.6em;
      position: absolute;
      left: 55em;
      top: -10em;
      }

      #changeRequested {
      font-family: arial, helvetica, sans-serif;
      font-size: 0.6em;
      position: absolute;
      left: 86em;
      top: -10em;
      }

      #itlisttableadmin {
      font-family: arial, helvetica, sans-serif;
      font-size: 0.8em;
      position: absolute;
      left: 0em;
      top: 8em;
      }

      th {
      font-family: arial, helvetica, sans-serif;
      font-size: 0.8em;
      color: maroon;
      }

      td {
      font-family: arial, helvetica, sans-serif;
      font-size: 0.8em;
      }

      IE of course garbles it up just because it's IE, but it works just fine in Opera. Everything looks exactly how it should. When I open the page in Firefox, the font-family and font-size for the #change sections work fine, but the positioning doesn't. All the other parts of the CSS work. Can someone tell me what I'm doing wrong? The CSS statement is called in the PHP like this echo "";.

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      I don't see any errors in the css code, but without knowing where the elements are in relation to the table it's hard to say if it makes sense or not...

      Despite everything, the person most likely to be fooling you next is yourself.

      4 1 Reply Last reply
      0
      • G Guffa

        I don't see any errors in the css code, but without knowing where the elements are in relation to the table it's hard to say if it makes sense or not...

        Despite everything, the person most likely to be fooling you next is yourself.

        4 Offline
        4 Offline
        47_MasoN_47
        wrote on last edited by
        #3

        They are supposed to be above the table and across the top like this http://i30.photobucket.com/albums/c305/m450n/opera.jpg But in Firefox they look like this http://i30.photobucket.com/albums/c305/m450n/firefox.jpg Do you need to see any pieces of the PHP code itself or would that make a difference?

        G 1 Reply Last reply
        0
        • 4 47_MasoN_47

          They are supposed to be above the table and across the top like this http://i30.photobucket.com/albums/c305/m450n/opera.jpg But in Firefox they look like this http://i30.photobucket.com/albums/c305/m450n/firefox.jpg Do you need to see any pieces of the PHP code itself or would that make a difference?

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          The identifiers are case sensetive, are the id:s of the elements exactly as you have written in the css? Some browsers ignore this rule and matches the identifiers as non case sensetive, which could explain why Opera applies the positioning but not Firefox. I'm just guessing here... that's the best I can do without seeing any of the html code...

          Despite everything, the person most likely to be fooling you next is yourself.

          4 1 Reply Last reply
          0
          • G Guffa

            The identifiers are case sensetive, are the id:s of the elements exactly as you have written in the css? Some browsers ignore this rule and matches the identifiers as non case sensetive, which could explain why Opera applies the positioning but not Firefox. I'm just guessing here... that's the best I can do without seeing any of the html code...

            Despite everything, the person most likely to be fooling you next is yourself.

            4 Offline
            4 Offline
            47_MasoN_47
            wrote on last edited by
            #5

            Yes I checked the cases, just to be sure I changed them to all lowercase in both places. No change in either browser. The odd thing is that I have another table setup (one for the admins and one for the users) that shows up perfectly in both Opera and Firefox. It's written the exact same way and I can't figure out why it is that the admin one won't work when the regular user one does. Suggestions on what to try next?

            G 1 Reply Last reply
            0
            • 4 47_MasoN_47

              Yes I checked the cases, just to be sure I changed them to all lowercase in both places. No change in either browser. The odd thing is that I have another table setup (one for the admins and one for the users) that shows up perfectly in both Opera and Firefox. It's written the exact same way and I can't figure out why it is that the admin one won't work when the regular user one does. Suggestions on what to try next?

              G Offline
              G Offline
              Guffa
              wrote on last edited by
              #6

              47_MasoN_47 wrote:

              Suggestions on what to try next?

              Show some code.

              Despite everything, the person most likely to be fooling you next is yourself.

              4 1 Reply Last reply
              0
              • G Guffa

                47_MasoN_47 wrote:

                Suggestions on what to try next?

                Show some code.

                Despite everything, the person most likely to be fooling you next is yourself.

                4 Offline
                4 Offline
                47_MasoN_47
                wrote on last edited by
                #7

                "; // Display retrieved data with while loop echo "

                "; echo ""; echo ""; while($row = mysql_fetch_array($request)){ // Print out list of IT requests into a table echo ""; } echo ""; echo "

                "; echo "

                "; echo "

                Case #:

                "; echo "

                New Status:

                "; echo "

                "; echo ""; echo "

                "; echo "

                "; echo "

                "; echo "

                Case #:

                "; echo "

                New User Name:

                "; echo "

                "; echo ""; echo "

                "; echo "

                "; echo "

                "; echo "

                Case #:

                "; echo "

                New Date Required:

                "; echo "

                "; echo ""; echo "

                "; echo "

                "; echo "

                Case #

                User Name

                Date Requested

                Date Required

                Problem

                Status

                "; echo $row['id']; echo "

                "; echo $row['userName']; echo "

                "; echo $row['dateRequested']; echo "

                "; echo $row['dateRequired']; echo "

                "; echo $row['problem']; echo "

                "; echo $row['status']; echo "

                G 1 Reply Last reply
                0
                • 4 47_MasoN_47

                  "; // Display retrieved data with while loop echo "

                  "; echo ""; echo ""; while($row = mysql_fetch_array($request)){ // Print out list of IT requests into a table echo ""; } echo ""; echo "

                  "; echo "

                  "; echo "

                  Case #:

                  "; echo "

                  New Status:

                  "; echo "

                  "; echo ""; echo "

                  "; echo "

                  "; echo "

                  "; echo "

                  Case #:

                  "; echo "

                  New User Name:

                  "; echo "

                  "; echo ""; echo "

                  "; echo "

                  "; echo "

                  "; echo "

                  Case #:

                  "; echo "

                  New Date Required:

                  "; echo "

                  "; echo ""; echo "

                  "; echo "

                  "; echo "

                  Case #

                  User Name

                  Date Requested

                  Date Required

                  Problem

                  Status

                  "; echo $row['id']; echo "

                  "; echo $row['userName']; echo "

                  "; echo $row['dateRequested']; echo "

                  "; echo $row['dateRequired']; echo "

                  "; echo $row['problem']; echo "

                  "; echo $row['status']; echo "

                  G Offline
                  G Offline
                  Guffa
                  wrote on last edited by
                  #8

                  Do you have a doctype, a html element, a head element and a body element, or is that all the code? There are elements using implicit end tags as in XHTML, but the code is not at all valid XHTML. There is no end tag for the table, which in itself may very well mess up the page.

                  Despite everything, the person most likely to be fooling you next is yourself.

                  4 1 Reply Last reply
                  0
                  • G Guffa

                    Do you have a doctype, a html element, a head element and a body element, or is that all the code? There are elements using implicit end tags as in XHTML, but the code is not at all valid XHTML. There is no end tag for the table, which in itself may very well mess up the page.

                    Despite everything, the person most likely to be fooling you next is yourself.

                    4 Offline
                    4 Offline
                    47_MasoN_47
                    wrote on last edited by
                    #9

                    That is all the code. Since it's PHP I didn't think about having a doctype and whatnot. I'll make some changes and just see what happens. Thanks for the suggestion, even if it doesn't fix it at least that's one more step making the code more valid.

                    G 1 Reply Last reply
                    0
                    • 4 47_MasoN_47

                      That is all the code. Since it's PHP I didn't think about having a doctype and whatnot. I'll make some changes and just see what happens. Thanks for the suggestion, even if it doesn't fix it at least that's one more step making the code more valid.

                      G Offline
                      G Offline
                      Guffa
                      wrote on last edited by
                      #10

                      47_MasoN_47 wrote:

                      That is all the code. Since it's PHP I didn't think about having a doctype and whatnot.

                      That means that what you are sending to the browser isn't even close to be a valid html document, or even an html document at all. The browsers makes their best to try to display it as html anyway, but you can't expect it to work properly. To be an html document, the page has to have a html, head, title and body tag:

                      <html>
                      <head>
                      <title>Minimal</title>
                      </head>
                      <body>
                      A minimal html document.
                      </body>
                      </html>

                      Despite everything, the person most likely to be fooling you next is yourself.

                      4 1 Reply Last reply
                      0
                      • G Guffa

                        47_MasoN_47 wrote:

                        That is all the code. Since it's PHP I didn't think about having a doctype and whatnot.

                        That means that what you are sending to the browser isn't even close to be a valid html document, or even an html document at all. The browsers makes their best to try to display it as html anyway, but you can't expect it to work properly. To be an html document, the page has to have a html, head, title and body tag:

                        <html>
                        <head>
                        <title>Minimal</title>
                        </head>
                        <body>
                        A minimal html document.
                        </body>
                        </html>

                        Despite everything, the person most likely to be fooling you next is yourself.

                        4 Offline
                        4 Offline
                        47_MasoN_47
                        wrote on last edited by
                        #11

                        Yeah I generally write valid XHTML 1.0 Strict, I just didn't think about it since it was inside PHP. I taught myself PHP and am still learning a lot. I have a strong feeling that is what the problem is. Over the weekend I'm going to go through each piece of this site and change it so that it's valid. Thanks a lot for the suggestion, I never would have thought about the browser being so confused at what I was trying to display.

                        4 1 Reply Last reply
                        0
                        • 4 47_MasoN_47

                          Yeah I generally write valid XHTML 1.0 Strict, I just didn't think about it since it was inside PHP. I taught myself PHP and am still learning a lot. I have a strong feeling that is what the problem is. Over the weekend I'm going to go through each piece of this site and change it so that it's valid. Thanks a lot for the suggestion, I never would have thought about the browser being so confused at what I was trying to display.

                          4 Offline
                          4 Offline
                          47_MasoN_47
                          wrote on last edited by
                          #12

                          For the record, after adding the proper tags to the HTML generated by the PHP and putting the end tag on the tables it fixed the problem. Now Firefox and Opera are both displaying the page in the same way.

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups