Ich habe diesen HTML-CodeWarum werden divs php überlappend eingefügt?
<html>
<head>
<meta charset="utf-8">
<title>Dashboard</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<?php
include 'functions.php';
$logs = getUnsuccessfulBuilds();
for ($i = 0; $i < sizeof($logs); $i++){
echo("<div class='errorlog'>");
echo($logs[$i]['name']);
echo($logs[$i]['id']);
echo("</div>");
}
?>
</body>
</html>
Und diese CSS-Code
body {
background-color: #27373d;
}
.container {
position: relative;
width: 100%;
height: 100%;
}
.errorlog {
display: block;
border-radius: 3px;
width: 10%;
overflow: hidden;
float: left;
background-color: #c6656a;
padding: 20px;
position: absolute;
margin: auto;
vertical-align: middle;
}
Warum sind die eingefügten Elemente farbig, aber nicht ausgerichtet sind, wie ich sie sein? Sie sind alle an der gleichen Position, auch wenn ich margin
ändere.
Entfernen Sie 'position: absolute;' von '.errorlog'. – jeroen
Danke, das war es :) – Barsch