Search code examples
javascripthtmlcssfixed

css position:fixed <script> tag within does not stay fixed


I'm having an issue trying to get a .js validation script to stay in a fixed location within a webpage.

My code for the css is:

div.fixed {
position: fixed;
bottom: 0;
left: 0;
}

HTML

<div class="fixed">
<script src="http://my.gblearn.com/js/javascript.js"></script>
</div>

I can add anything inside that div tag and it will rise above the top and stay fixed to the bottom left, but the javascript file will just stay where I've placed it within the webpage as if it can't be bothered to adhere to the .css rule.

I was wondering how I could get around this. Thank you for all your help.


Solution

  • So, after much toying around, we figured out that viewing the source code for my website, we could see the javascript output. The .js file showed id's and we made a .css portion of the code to show the outputted information like so:

    css

    nav, #gblearn_message_holder {
    position: fixed;
    bottom: 0;
    left: 0;
    width: auto;
    }
    

    html

    <div id="gblearn_message_holder">
    <a title="Validate this page" href="javascript:void(0)" onclick="GBLEARN_TESTER.validatePage(this.form)">
    <img src="http://my.gblearn.com/img/HTML5_Logo_2561.png" alt="html5 validator">
    </a><a href="http://jigsaw.w3.org/css-validator/check/referer">
    <img style="border:0;width:99px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS!"></a>
    <br>This page was last modified on 3/29/2017, 7:17:04 PM</div>