Wenn ich am Anfang meines Dokuments <!DOCTYPE html>
hinzufügen, funktioniert dieser Übergang nicht mehr. Warum?Mein CSS-Übergang funktioniert nicht, wenn ich die <html> Tags hinzufügen
Dies funktioniert (in Chrome und Microsoft Edge):
<html>
<head>
<title></title>
<style type="text/css">
.container{
width: 400px;
margin-left: auto;
margin-right: auto;
background-color: #9FC;
}
.gradBox {
width: 300px;
height: 100px;
margin-right: auto;
margin-left: auto;
margin-top: 20px;
margin-bottom: 20px;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
-webkit-transition: width 1s;
transition: width 1s;
}
.gradBox:hover {
width: 400;
}
#grad1 {
background: linear-gradient(to right, #F00 1%, #FF0 25%, #0F0 50%, #0FF 75%, #00F 100%)
}
</style>
</head>
<body>
<div class="container">
<div class="gradBox" id="grad1">
</div>
</div>
</body>
</html>
Dies funktioniert auch nicht:
<!DOCTYPE html>
<html>
<head>
<title></title>
... (the rest of the markup is identical)
Beide scheinen für mich gut zu funktionieren. – thepio
beide Codebeispiele sind gleich? – since095
@ since095: Das zweite Beispiel benutzt HTML5 – WorkWe