www.webdeveloper.com
Results 1 to 5 of 5

Thread: Problem with divs

Hybrid View

  1. #1
    Join Date
    Dec 2012
    Posts
    1

    Problem with divs

    Hello there, I have this problem with a "website" I'm creating. I've created a container with a Logo box, a navigation box and 2 boxes under the navigationbox who are placed right next to eachother. The problem is that the footer is bugging and gets placed over the 2 boxes. I want the below the 2 boxes.

    This is how the "website" looks like live. I colored the different divs so you can see where they're placed.

    Live image of the website.

    I want the purple one to be on the bottom below the 2 divs that are next to eachother.

    Here's the HTML code:

    Code:
    <head>
    <link href="style.css" rel="stylesheet" type="text/css" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Europa Hemsida</title>
    </head>
    
    <body>
    
    <center>
    <div class="container>
    <div class="logo">
    <img src="bilder/logga.jpg" />
    </div>
    
    <div class="link">
    <a href="start.html" target="iframe" onMouseOver="document.hem.src='bilder/hem-mouseover.jpg';" onMouseOut="document.hem.src='bilder/hem.jpg';"> 
    <img src="bilder/hem.jpg" name="hem">
    </a>
    
    <a href="italien.html" target="iframe" onMouseOver="document.italien.src='bilder/italien-mouseover.jpg';" onMouseOut="document.italien.src='bilder/italien.jpg';"> <img src="bilder/italien.jpg" name="italien">
    </a>
    
    <a href="tyskland.html" target="iframe" onMouseOver="document.tyskland.src='bilder/tyskland-mouseover.jpg';" onMouseOut="document.tyskland.src='bilder/tyskland.jpg';"> 
    <img src="bilder/tyskland.jpg" name="tyskland">
    </a>
    
    <a href="frankrike.html" target="iframe" onMouseOver="document.frankrike.src='bilder/frankrike-mouseover.jpg';" onMouseOut="document.frankrike.src='bilder/frankrike.jpg';"> 
    <img src="bilder/frankrike.jpg" name="frankrike">
    </a>
    
    <a href="england.html" target="iframe" onMouseOver="document.england.src='bilder/england-mouseover.jpg';" onMouseOut="document.england.src='bilder/england.jpg';"> 
    <img src="bilder/england.jpg" name="england">
    </a>
    </div>
    
    <div id="wrap">
    <div class="leftnav">
    <iframe src="start.html" name="iframe" height="598px" width="150px" frameborder="0"></iframe>
    </div>
    
    <div class="main">
    <iframe src="start.html" name="iframe" height="598px" width="874px" frameborder="0"></iframe>
    </div>
    </div>
    <div class="footer">
    &copy; All rights reserved - Europa sida 2012
    </div>
    
    </div>
    
    </body>
    </html>
    Here's the CSS code:

    Code:
    body {background-color:#333
    }
    
    .container {
    	color: #93C;
    	position: relative;
    	height: 768px;
    	width: 1024px;
    	border: 2px solid #C0C0C0;
    }
    .logo {
    	font-family: Verdana, Geneva, sans-serif;
    	font-size: 24px;
    	font-weight: bold;
    	background-color: #3FF;
    	position: relative;
    	height: 100px;
    	width: 1024px;
    }
    .link {
    	background-color: #EEE;
    	position: relative;
    	height: 50px;
    	width: 1024px;
    }
    #wrap {
    	width:1024px; height:598;
    	position:relative;
    }  
    .main {
    	background-color: #FFF;
    	position: relative;
    	height: 598px;
    	width: 874px;
    	float: right;
    }
    .leftnav{
    	background-color: #0F3;
    	position: relative;
    	height: 598px;
    	width: 150px;
    	float: left;
    	border-right: 1px; color:#000;
    }
    .footer {
    	background-color: #936;
    	position: relative;
    	height: 20px;
    	width: 1024px;
    	font-family:Arial, Helvetica, sans-serif; color:#000;
    }
    Please help, this is a schoolproject and my teacher doesen't know what the problem is either so I need help from you guys...

  2. #2
    Join Date
    Aug 2012
    Posts
    155
    What browser are you viewing this in as I have loaded your code in Chrome and the layout displays as expected (though there are issues with your code)? Well as far as I can tell without the correct paths to your images and iframes.

  3. #3
    Join Date
    Dec 2012
    Posts
    1
    Add the following to rule to your wrap style...


    #wrap {
    width:1024px; height:598;
    position:relative;
    clear:both;
    }

  4. #4
    Off-topic but, you can add margin in your .container class to center align the layout instead of using <center> tag, like :
    .container {
    color: #93C;
    position: relative;
    height: 768px;
    width: 1024px;
    border: 2px solid #C0C0C0;
    margin:auto;
    }

  5. #5
    hello,

    Add this line before ending div of #wrap
    <div style="clear:both;"></div>


    or you can add CLEAR in your .footer class, like:
    .footer {
    background-color: #936;
    position: relative;
    height: 20px;
    width: 1024px;
    font-family:Arial, Helvetica, sans-serif; color:#000;
    clear:both;
    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

"

"

X vBulletin 4.2.2 Debug Information

  • Page Generation 0.36369 seconds
  • Memory Usage 3,020KB
  • Queries Executed 13 (?)
More Information
Template Usage (31):
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (5)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (27):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./includes/functions_threadedmode.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (71):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates