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 to the CF scene
    Join Date
    Dec 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    New to CSS: Multiple questions about my code

    I'm new to the forum, so let me say hello! First, the code:

    index.html
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>I Love MURC</title>
    <link href="css/default.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    
    <!-- this creates the background image -->
    <div id="bg_image">
    <img src="images/background.jpg" style="width: 100%; height: 100%;">
    </div>
    
    <!-- The wrapper puts the contents of the page on top of the background image while
    	 the container contains the contents of the page! -->
    <div id="wrapper">
    <div class="container">
    
    
    
    <div class="top">
    	Top content
    </div>
    
    <div class="navigation">
    	Navigation content
    </div>
    
    <div class="main">
    	Main content
    </div>
    
    <div class="bottom">
    	Bottom content
    </div>
    
    
    
    </div>
    </div>
    </body>
    </html>
    default.css
    Code:
    /* CSS Document */
    
    /* Default Background Color and Zero-out all Margins */
    body {
    background-color:#666666;
    margin: 0;
    }
    
    /* Create Background Image div with no margins */
    #bg_image {
    width: 100%;
    height: 100%;
    left: 0px;
    top: 0px;
    position: absolute;
    z-index: 0;
    }
    
    /* Create layer for everything else to go into, on top of the Background Image layer */
    #wrapper {
    z-index: 1;
    position: absolute;
    }
    
    /* Create container for contents so it's easier to position the contents */
    div.container {
    	position: relative;
    	margin: 0 auto;
    	width: 580px;
    	height: 780px;
    }
    
    div.top {
    	position: absolute;
    	top: 0px;
    	left: 0px;
    	width: 580px;
    	height: 150px;
    	border-color: black;
    	border-width: thick;
    	background-color: white;
    }
    
    div.navigation {
    	position: absolute;
    	top: 150px;
    	left: 0px;
    	width: 580px;
    	height: 30px;
    	border-color: black;
    	border-width: thick;
    	background-color: white;
    }
    
    div.main {
    	position: absolute;
    	top: 180px;
    	left: 0px;
    	width: 580px;
    	height: 550px;
    	border-color: black;
    	border-width: thick;
    	background-color: white;
    }
    
    div.bottom {
    	position: absolute;
    	top: 730px;
    	left: 0px;
    	width: 580px;
    	height: 50px;
    	border-color: black;
    	border-width: thick;
    	background-color: white;
    }
    I've searched through the forum and can't piece together the answers to my questions:
    • Why aren't the content boxes showing the black border?
    • I want to create a directory-type navigation in the navigation section, rather than the typical tabs. Can someone point me in the right direction? Let me elaborate a bit more. All my searches for hierarchical navigation turn up the pull-down menu navigation; whereas, I'm looking for a navigation that would look like this: HOME > Folder > Sub-Folder > Sub-Sub-Folder
    • I have content in the main section, how do I tell the browser to open an html file in the main class?
    • The container is positioned as relative... why aren't the classes inside of it centering on the page *in Firefox*? (IE works fine)
    • The background image shows fine in Firefox, but in IE it does not. Why?
    Last edited by cswake; 12-05-2005 at 03:07 AM.

  • #2
    Regular Coder
    Join Date
    Aug 2004
    Location
    Nashville
    Posts
    202
    Thanks
    0
    Thanked 0 Times in 0 Posts

    try this

    For your question about the borders - try this:

    border: 2px solid #000000;

    for the background issue - IE is funny about background images - there are some hacks out there and you'll find plenty of examples by googling: "CSS background images not showing up in IE"

  • #3
    New to the CF scene
    Join Date
    Dec 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the quick reply. I had done a similar search and the answers I found were related to either javascript or some sort of "min-height min-width" values. Is the second the hack?


  •  

    Posting Permissions

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