Can you set a border opacity in CSS?

Unfortunately the opacity property makes the whole element (including any text) semi-transparent. The best way to make the border semi-transparent is with the rgba color format. For example, this would give a red border with 50% opacity: div { border: 1px solid rgba(255, 0, 0, .5); -webkit-background-clip: padding-box; /* for Safari */ background-clip: padding-box; /* … Read more

Error: CSS: background: / is an incorrect operator

If we refer to the formal syntax: The / is the separation between background-position and background-size (this one being optional) so the correct syntax is: background: url(…) 100% 0/4% no-repeat; Where background-position:100% 0 and background-size:4% Note that background-size should always be specified with background-position when using shorthand syntax. You cannot specify the size without position … Read more

How to thematize in lesscss

It all depends on how many styles and variables differ between themes, for example a (very) basic staring point could be something like: @themes: blue rgb( 41, 128, 185), marine rgb( 22, 160, 133), green rgb( 39, 174, 96), orange rgb(211, 84, 0), red rgb(192, 57, 43), purple rgb(142, 68, 173); // usage: #navBar { … Read more

Hexagon shape with CSS3

A simple search turned this up: CSS Hexagon Tutorial Referenced from the site: Put a 104px × 60px div with a background colour between them and you get (the hexagon): width: 0; border-bottom: 30px solid #6C6; border-left: 52px solid transparent; border-right: 52px solid transparent; width: 104px; height: 60px; background-color: #6C6; width: 0; border-top: 30px solid … Read more

Outlining and partially filling an SVG Shape

You can alternatively do this with a filter. Here is one that animates the fill: <svg height=”210″ width=”500″> <defs> <filter id=”fillpartial” primitiveUnits=”objectBoundingBox” x=”0%” y=”0%” width=”100%” height=”100%”> <feFlood x=”0%” y=”0%” width=”100%” height=”100%” flood-color=”red” /> <feOffset dy=”0.5″> <animate attributeName=”dy” from=”1″ to=”.5″ dur=”3s” /> </feOffset> <feComposite operator=”in” in2=”SourceGraphic” /> <feComposite operator=”over” in2=”SourceGraphic” /> </filter> </defs> <polygon filter=”url(#fillpartial)” points=”165.000, … Read more