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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Nov 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Css Hiding Divs Need Help

    Hello, I'm wondering if there is a simpler way of hiding divs you don't want showed on one stylesheet but do on another.

    This way works prefect however it will cause alot of coding to be wrote for every div that shouldn't be showed.

    Style sheet one
    Code:
    #footer1 {  }
    #footer2 { display:none; }
    #footer3 { display:none; }
    #footer4 { display:none; }
    Style sheet two

    Code:
    #footer1 { display:none; }
    #footer2 {  }
    #footer3 { display:none; }
    #footer4 { display:none; }
    Last edited by unknownsoul; 11-27-2008 at 01:23 AM. Reason: fixed

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello unknownsoul,
    It might be easier to use a php include. You could write the 4 different footers and put them in one dir, the in each page that you wanted to use a footer, you could load it with a line like this
    Code:
    <div id="footer">
      		  <?php include("../footer_1.php"); ?>
    </div>
    It's pretty simple to set up, just google php include.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    New to the CF scene
    Join Date
    Nov 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Excavator View Post
    Hello unknownsoul,
    It might be easier to use a php include. You could write the 4 different footers and put them in one dir, the in each page that you wanted to use a footer, you could load it with a line like this
    Code:
    <div id="footer">
      		  <?php include("../footer_1.php"); ?>
    </div>
    It's pretty simple to set up, just google php include.
    I know I'm already using that coding. I still have some problems with this method other then the fact of the css coding build up.

    Better Demo

    Style Sheet 1
    Code:
    #footer1 { visibility:visible; }
    #footer2 { visibility:hidden; }
    Style Sheet 2
    Code:
    #footer1 { visibility:hidden; }
    #footer2 { visibility:visible; }
    Content
    Code:
    <div id="footer1"><?php include("footer1.php"); ?></div>
    <div id="footer2"><?php include("footer2.php"); ?></div>
    If sheet one is selected then it will show footer1 and hide footer2, if sheet two selected it will hide footer1 and show footer2.

    Which it all works fine, but on the basic page style sheet It shows both. Style sheet one is my basic sheet right now.

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    I was following you fine till this -
    but on the basic page style sheet It shows both. Style sheet one is my basic sheet right now.
    You lost me there...
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #5
    New to the CF scene
    Join Date
    Nov 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ah sorry, I've fixed my problem. I had an onclick thing I was testing which was calling the divs to show. Anyways 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
    •