1
Ich kann nicht herausfinden, warum der Stil nicht für Rechteck gilt.CSS funktioniert nicht bei der Anwendung auf Rechteck-Klasse?
Stil
<style>
.bar {
width: 100;
height: 100;
fill: green;
}
</style>
svg
<body>
<svg width="100" height="100">
<rect class="bar"/>
</svg>
</body>
, wenn ich nach joe_young Vorschläge ändern, es funktioniert in Chrome, aber nicht in Firefox:
<!DOCTYPE html>
<meta charset="utf-8">
<html>
<head>
<style>
.bar {
width: 100px;
height: 100px;
fill: green;
}
</style>
</head>
<body>
<svg width="100" height="100">
<rect class="bar" />
</svg>
</body>
</html>
Ihre ''