Problem bei der Umschließung von Divs
Chantal
- css
Hi,
ich bastele hier gerade an einer Seite und habe folgendes Problem:
Die #border_home soll #content_left und #content_right umschließen. Im Ie tut sie das auch, nur leider im ff nicht. Hier mal der 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>Megashot Profile</title>
<?php /////////////////////////////start////////////////////////////////////// ?>
<link rel="stylesheet" type="text/css" href="profile_designs/cssjs/main.css" />
<div id="container">
<div class="header_img"><img src="profile_designs/content_image/top_menu_deflt_banner.jpg" class="rec_pic" alt="testimg" style="margin:0; padding:0;"/></div>
<div class="top_menu" style=" height:87px; width:1024px;">
<div class="top_left">
<a href="#">Home</a>
<a href="#">Profile</a>
<a href="#">Galleries</a>
<a href="#">Favorites</a>
<a href="#">Network</a>
<a href="ms-commerce.php">Home Store</a>
<a href="javascript:popUpp('ms-profile-customize.php','580','500')">Customize</a>
<a href="#">Themes</a>
</div>
<div class="top_right">
<a href="#">You</a>
</div>
</div>
<div class="clear"></div>
<div id="border_home">
<div id="content_left">
<span class="welcome">Hello </span>
<div class="border_boxes">
<div class="box_bg">
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
</div>
</div>
<span class="box_header">About</span>
<div class="border_boxes">
<div class="box_bg">
</div>
</div>
<div class="border_boxes">
<div class="box_bg">
<div class="category"><a href="#">Send Mega Mail</a><a href="#"> Send to a Friend</a> <a href="#">Add as a Contact</a><a href="#"> Block</a></div>
</div>
</div>
<span class="box_header">Recent Visitors</span>
<div class="border_boxes">
<div class="box_bg">
</div>
</div>
<span class="box_header">Randome Favourites</span>
<div class="border_boxes">
<div class="box_bg">
</div>
</div>
<span class="box_header">Network</span>
<div class="border_boxes">
<div class="box_bg">
</div>
</div>
<span class="box_header">Popular Fotos</span>
<div class="border_boxes">
<div class="box_bg">
</div>
</div>
<span class="box_header">Communities</span>
<div class="border_boxes">
<div class="box_bg">
</div>
</div>
</div>
<div class="ztr">
<div class="content_right">
<div class="content_right_left_col">
<div id="space"></div>
<span class="box_header">Recent Photos</span>
<div class="border_boxes">
<div class="box_bg">
<div align="center">
<img src="profile_designs/content_image/pic1.gif" class="rec_pic" alt="testimg"/>
<img src="profile_designs/content_image/pic2.gif" class="rec_pic" alt="testimg"/>
<img src="profile_designs/content_image/pic3.gif" class="rec_pic" alt="testimg"/>
<a class="upload" href="#">Upload</a><br /><br />
<br />
</div>
</div>
</div>
</div>
<div id="content_right_right_col">
<div class="no_bg">
251 Photos<br />666621 Comments made<br />5643 Comments Received<br />354 Forum Posts<br />1000061 Page viewed<br/>199187 Page Visitors
</div>
<span class="box_header">Favourite Artists</span>
<div class="no_bg">
</div>
</div>
<div class="clear"></div>
<span class="box_header">Favourite Video</span>
<div class="border_boxes">
<div class="box_bg">
<div align="center">
<?php include("includes/useful_videos.php"); ?>
</div>
</div>
</div>
<span class="box_header">Favourite Links</span>
<div class="border_boxes">
<div class="box_bg">
BOX
</div>
</div>
<span class="box_header">Guestbook</span>
<div class="border_boxes">
<div class="box_bg">
BOX
</div>
</div>
</div>
</div>
</div>
</div>
<div class="clear"></div>
<div id="footer_1"><div class="box_bg"><?php include("foot_1.php");?></div></div>
<div id="footer_2"><?php include("foot_2.php");?></div>
</div>
</body>
</html>
Ich würde mich freuen, wenn Ihr mir hlefen könntet.
Chantal
[latex]Mae govannen![/latex]
Die #border_home soll #content_left und #content_right umschließen. Im Ie tut sie das auch, nur leider im ff nicht. Hier mal der Code:
Ich würde mich als Browser auch weigern, soetwas anzuzeigen ;)
Sehr schwerer Fehler: Dem Code fehlt an geeigneter Stelle das schließende </head> tag und auch das öffnende <body>-tag.
<?php /////////////////////////////start////////////////////////////////////// ?>
?
<span class="box_header">Recent Visitors</span>
(und weitere ähnliche) Eine Überschrift ist eine Überschrift und möchte sooo gerne auch als solche ausgezeichnet werden.
Ansonsten ist der Code eine grausige div-Suppe mit noch weiteren Fehlern, die ich aber erst einmal weglasse.
Aber sieh erst einmal zu, daß die wichtigen Tags ergänzt werden und der Validator nicht mehr meckert.
Cü,
Kai
Hi,
Die #border_home soll #content_left und #content_right umschließen. Im Ie tut sie das auch, nur leider im ff nicht. Hier mal der Code:
Aha, das HTML. Und die Formatierung ...?
<link rel="stylesheet" type="text/css" href="profile_designs/cssjs/main.css" />
Meine Glaskugel sagt mir, dass du die - unguenstig benannten, eine ID oder Klasse sollte sich nicht aus der *derzeit* gewuenschten Darstellung ableiten - Elemente #content_left und #content_right gefloatet hast, ohne dir der Auswirkungen von float bewusst zu sein.
Beseitige die schon angesprochenen Fehler in deinem HTML - und dann lerne, die Auswirkungen des floatings zu verstehen.
MfG ChrisB
Hi Chris,
vielen dank. Overflow hat es rausgerissen.
Chantal
Hallo,
der code ist jetzt valide, die psans werde ich auch noch in headlines ändern.
Hier nochmal mein Quellcode
<!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>...</title>
<style type="text/css">
body {margin:0;font-family:verdana}
#spacebet{ padding:8px;}
#container{width:1024px; margin:0 auto 0 auto;padding:0px;}
#header_img{width:1024px;height:auto;padding:0;margin:0;background: #ffffcc;}
.top_menu a{text-decoration:none;}
.clear{clear:both;width:100%}
.welcome{font-size:13px;margin:12px 0 12px 0;display:block;}
#border_home {border: 5px solid red;border-top:0px; width:1014px;margin-top:70px;font-size:12px;height:auto}
.content_left{float:left;width:522px;margin-left:5px;}
.content_right{float:right;width:475px;margin-right:5px}
#content_left, #content_right {padding:0px}
.box_header{font-size:16px;font-weight:bold;display:block;margin:15px 0 9px 10px}
.border_boxes { border:solid 1px #333333;margin:10px 10px 35px 10px}
.box_bg { background-color:#000000;padding:12px}
#content_right_right_col{float:right;width:220px;}
#content_right_left_col{float:left;width:235px;}
.category{text-align:center}
.category a{font-size:13px;margin-right:10px;text-decoration:none}
.comment_box_bg{ background-color:#3B3B3B;}
.rec_pic{margin:15px 0 15px 0}
.upload{font-size:11px; float:right;display:block; margin:0 0 25px 0;text-decoration:none}
#footer_1{background:tansparent;width:100%;height:auto;border-top: 1px solid #ebebeb;text-align:center;padding:0px 0 20px 0}
.footlink{display:block;margin:20px 0 20px 0}
#footer_1 a, #footer_2 a {color: #54534f;font-size:13px;margin:20px;text-decoration:none}
#footer_2{background:black;width:100%;height:30px;padding:10px 0 10px 0;text-align:center}
#footer_2 a{color: #ffffe1;
}
#clear_content{clear:both}
</style>
</head>
<body>
<div id="container">
<div class="header_img"><img src="profile_designs/content_image/top_menu_deflt_banner.jpg" class="rec_pic" alt="testimg" style="margin:0; padding:0;"/></div>
<div class="top_menu" style=" height:87px; width:1024px;">
<div class="top_left">
<a href="#">Home</a>
<a href="#">Profile</a>
<a href="#">Galleries</a>
<a href="#">Favorites</a>
<a href="#">Network</a>
<a href="ms-commerce.php">Home Store</a>
<a href="javascript:popUpp('ms-profile-customize.php','580','500')">Customize</a>
<a href="#">Themes</a>
<?php ////////////////////////////////start/////////////////////////////////// ?>
</div>
<div class="top_right">
<a href="#">Megashot</a>
<a href="#">You</a>
</div>
</div>
<div class="clear"></div>
<div id="border_home">
<div class="content_left">
<div class="border_boxes">
<div class="box_bg">
</div>
</div>
<span class="box_header">About</span>
<div class="border_boxes">
<div class="box_bg">
</div>
</div>
<div class="border_boxes">
<div class="box_bg">
<div class="category"><a href="#">Send Mega Mail</a><a href="#"> Send to a Friend</a> <a href="#">Add as a Contact</a><a href="#"> Block</a></div>
</div>
</div>
<span class="box_header">Recent Visitors</span>
<div class="border_boxes">
<div class="box_bg">
</div>
</div>
<span class="box_header">Randome Favourites</span>
<div class="border_boxes">
<div class="box_bg">
</div>
</div>
<span class="box_header">Network</span>
<div class="border_boxes">
<div class="box_bg">
</div>
</div>
<span class="box_header">Popular Fotos</span>
<div class="border_boxes">
<div class="box_bg">
</div>
</div>
<span class="box_header">Communities</span>
<div class="border_boxes">
<div class="box_bg">
</div>
</div>
</div>
<div class="content_right">
<div id="content_right_left_col">
<div id="space"></div>
<span class="box_header">Recent Photos</span>
<div class="border_boxes">
<div class="box_bg">
<div align="center">
<img src="profile_designs/content_image/pic1.gif" class="rec_pic" alt="testimg"/>
<img src="profile_designs/content_image/pic2.gif" class="rec_pic" alt="testimg"/>
<img src="profile_designs/content_image/pic3.gif" class="rec_pic" alt="testimg"/>
<a class="upload" href="#">Upload</a><br /><br />
<br />
</div>
</div>
</div>
</div>
<div id="content_right_right_col">
<div class="no_bg">
....
</div>
<span class="box_header">Favourite Artists</span>
<div class="no_bg">
</div>
</div>
<div class="clear"></div>
<span class="box_header">Favourite Video</span>
<div class="border_boxes">
<div class="box_bg">
<div align="center">
<?php include("includes/useful_videos.php"); ?>
</div>
</div>
</div>
<span class="box_header">Favourite Links</span>
<div class="border_boxes">
<div class="box_bg">
BOX
</div>
</div>
<span class="box_header">Guestbook</span>
<div class="border_boxes">
<div class="box_bg">
BOX
</div>
</div>
</div>
</div>
</div>
<div class="clear"></div>
<div id="footer_1"><div class="box_bg"><?php include("foot_1.php");?></div></div>
<div id="footer_2"><?php include("foot_2.php");?></div>
</body>
</html>
Auch gelobe ich in Sachen Div Suppe Besserung. Mein Problem besteht jedoch nach wie vor.
Chantal
Hi,
Mein Problem besteht jedoch nach wie vor.
Das liegt vermutlich daran, dass du noch nichts unternommen hast, um es zu beseitigen.
Deshalb schlage ich vor, du liest meine erste Antwort noch mal.
MfG ChrisB