Skip to main content
100%

opacity vs. fill-opacity example

✓ Published0🌍 Public
335degrees
Last edited Jun 20, 2017
Created on Jun 20, 2017

This example demonstrates the visual difference between SVG opacity attributes by placing three circles with distinct transparency settings side by side. It shows how `fill-opacity` affects only the fill color, while `opacity` fades the entire element including its stroke, and how combining `fill-opacity` with `stroke-opacity` allows independent control of fill and stroke transparency. Built with D3 v4, the code appends circles and reference lines to an SVG, using attributes like `attr("fill-opacity", "0.5")` and `style("stroke", "Red")` to style each element. Additional polylines and lines illustrate stroke properties such as `stroke-linecap` and `stroke-linejoin`, with hover effects defined via CSS on the `.dot` class.

AI-generated description

Built with blockbuilder.org

forked from <a href='http://bl.ocks.org/35degrees/'>35degrees</a>'s block: <a href='http://bl.ocks.org/35degrees/696596b6cf8a7932884ad0ef72928f16'>text example</a>

forked from <a href='http://bl.ocks.org/35degrees/'>35degrees</a>'s block: <a href='http://bl.ocks.org/35degrees/8a2bcd867fccf7394c5c149e53b0d9e2'>transform, translate example</a>

forked from <a href='http://bl.ocks.org/35degrees/'>35degrees</a>'s block: <a href='http://bl.ocks.org/35degrees/e2fc6c90c9d38cc6ae19f6dda8759310'>transform, scale example</a>

forked from <a href='http://bl.ocks.org/35degrees/'>35degrees</a>'s block: <a href='http://bl.ocks.org/35degrees/87187327885c9f235217daa23e2f7a57'>transform, scale example</a>

forked from <a href='http://bl.ocks.org/35degrees/'>35degrees</a>'s block: <a href='http://bl.ocks.org/35degrees/4d951e9b64c4dd1ad021307864e8b124'>transform, scale example</a>

forked from <a href='http://bl.ocks.org/35degrees/'>35degrees</a>'s block: <a href='http://bl.ocks.org/35degrees/7e9397a80add2f981127f0461dca2e87'>textLength, spacingandglyphs example</a>

mit Licensed

Similar vizzes