javascript - Drawing multiple SVG lines side by side -
<!doctype html> <html> <head> <meta charset="utf-8"> <title>js bin</title> </head> <body> <svg width="250" height="250"> <line x1="0" y1="100" x2="0" y2="37" stroke="red" stroke-width="50"></line> <line x1="50" y1="100" x2="50" y2="37" stroke="blue" stroke-width="50"></line> </svg> </body> </html>
i hoping code allow me display red bar , blue bar of equal widths side side. not, ideas why ?
the line stroke grow both sides. in case think must use rect instead lines.
<svg width="150" height="250"> <rect width="50" height="100" x="0" y="0" fill="red"/> <rect width="50" height="100" x="50" y="0" fill="blue" /> </svg>
see this running demo.
Comments
Post a Comment