I’m trying to have a box that’s got three light tubes around it in CSS. What I have right now looks like this:
<div class="neon1" style="height:100%">
<div class="neon2" style="height:100%">
<div class="neon3" style="height:100%">
<div class="neon4" style="height:100%">
RenderSidebar
</div>
</div>
</div>
</div>
.neon4 {
outline: none;
border-radius: 7px;
border-color: red;
box-shadow: 0 0 10px red;
padding: 5px;
border-bottom: none;
border-width: 20px
}
.neon3 {
outline: none;
border-radius: 10px;
border-color: darkorange;
box-shadow: 0 0 10px darkorange;
padding: 5px;
border-bottom: none;
}
.neon2 {
outline: none;
border-radius: 13px;
border-color: blue;
box-shadow: 0 0 10px blue;
padding: 5px;
border-bottom: none;
}
.neon1 {
outline: none;
border-radius: 16px;
border-color: blue;
box-shadow: 0 0 2px blue;
padding: 5px;
background-color: white;
border-bottom: none;
}
What I was trying to accomplish was much brighter and more vivid. This came out like it was done in pastels. I’ve tried fiddling with the values, but nothing seems to give the result I’m looking for.
Also, and this is more minor, is there a way to have the CSS do the job of creating and nesting the divs instead of having to do it in the HTML?
Thanks!
Lisa
2
Answers
By having no concept provided, it’s hard to answer but:
You can use white color with low opacity like there be a parent e.g. blue, and childs have glass-like background
what I mean is each child brightens the previous one.
consider
.container
as main parent which has nested.mask
s like:You are after something like this? An element surrounded by three light tubes?
The secret to making a light tube is to have a border and two shadows, one outside and one inside.
Here is a snippet which produces the effect you see above.