8 Replies Latest reply on Apr 3, 2014 1:52 PM by nilesk

    div id behaves unpredictably

    nilesk Level 1

      One of my embedded AP div elements has an ID "text" assigned to it; try as I might I cannot make it stay in a fixed position despite "float" being set to "none" in the css. If, however, I change the tag to something else, like "section" in the external style sheet it does what I want it to. What's going on? Embedded css overrides external css, yes?

        • 1. Re: div id behaves unpredictably
          MurraySummers Level 8

          Can we see either the live page, or the HTML and CSS on the page, please?

           

          Embedded CSS only overrides external CSS when it occurs after the external link.

          • 2. Re: div id behaves unpredictably
            nilesk Level 1

            website is not online, but here's the code (external css not shown):

             

            <!doctype html>

            <html>

            <head>

            <meta charset="UTF-8">

            <title>Profile</title>

             

             

            <link href="../css_files/nka.css" rel="stylesheet" type="text/css">

            <style type="text/css">

             

             

            #text {

                      position: absolute;

                      top: 145px;

                      width: 290px;

                      height: 803px;

                      z-index: 1001;

                      font-size: 15px;

                      background-color: rgba(204,204,204,0.6);

                      right: 116px;

                      padding-top: 40px;

                      padding-right: 20px;

                      padding-bottom: 8px;

                      padding-left: 80px;

                      float: none;

            }

            </style>

            </head>

             

             

            <body>

            <!--end navigation-->

             

             

            <header><a href="Index.html">Niels Kampmann <span class="regular">Architect</span></a></header>

             

             

            <nav>

              <ul>

                  <li><a href="#">Profile</a>

                    <ul>

                    </ul>

                  </li>

                <li><a href="#">Selected Projects</a>

                  <ul>

                      <li><a href="#">Warwick House</a></li>

                      <li><a href="#">Washingtonville Studio</a></li>

                      <li><a href="#">Elysburg House</a></li>

                      <li><a href="#">etc</a></li>

                  </ul>

                  </li>

                  <li><a href="#">Contact</a></li>

              </ul>

            </nav>

            <div id="text">etc etc

            <br>

            <br>

            <br>

            <img src="../images/02_profile/nkpict.jpg" width="163" height="195" alt="Niels" style="float:right;"></div>

            </body>

            </html>

            • 3. Re: div id behaves unpredictably
              MurraySummers Level 8

              Your problem has nothing to do with floats and everything to do with your use of absolute positioning to try to locate the div on the rendered page (you cannot float an absolutely positioned element anyhow). Why do you feel the need to use positioning at all?

               

              It should be a simple matter to place that div and its contents but to be sure you get there quickly, please upload the page and its dependent files and tell us exactly what you want the page to do. You'll get your answer in a jiffy!

              1 person found this helpful
              • 4. Re: div id behaves unpredictably
                nilesk Level 1

                I'm very likely missing something basic here, unfortunately I can't send you a link until the site is up & running; to be cont'd.

                • 5. Re: div id behaves unpredictably
                  Nancy OShea Adobe Community Professional & MVP

                  Make a test page and upload it to your server.  When your question is answered, you can remove the test page from your server.

                   

                   

                  Nancy O.

                  • 6. Re: div id behaves unpredictably
                    nilesk Level 1

                    Nancy O. wrote:

                     

                    Make a test page and upload it to your server.  When your question is answered, you can remove the test page from your server.

                     

                     

                    Nancy O.

                    You mean I should sign on with an ISP, then upload the relevant page? I was going to do that when the site is ready to roll.

                    • 7. Re: div id behaves unpredictably
                      Nancy OShea Adobe Community Professional & MVP

                      You should procure your domain name & web hosting right away so you can test & debug  on the actual server before you officially launch your new site.  Otherwise, you may have many unwanted surprises on launch day.

                       

                       

                      Nancy O.

                      1 person found this helpful
                      • 8. Re: div id behaves unpredictably
                        nilesk Level 1

                        OK, good point; I'll get back later.