Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2003
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    overlapping layers

    I have code that makes some text visible when clicking on a link:

    <style>
    .b { color: blue; visibility: hidden; }
    </style>

    <script>
    function dothis(letter){
    document.getElementById(letter).style.visibility = "visible";
    }
    </script>


    <span id="a" class="b">this is a</span>
    <span id="c" class="b">this is c</span>
    <P>
    <a href="javascript:dothis('a')">see changes a</a>
    <a href="javascript:dothis('c')">see changes c</a>

    Problem is, when you click on 'c', the line "this is c" does not start from the edge of the page. how do I fix that? Thanks.

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Try using DIVs

    <div id="a" class="b">this is a</div>
    <div id="c" class="b">this is c</div>

  • #3
    New Coder
    Join Date
    May 2003
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This makes 'c' begin on a new line. thanks.


  •  

    Posting Permissions

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