I’m really desperate with this. I want to make a responsive circle and inside this circle will be transparent horizontal lines and you can easily change their size and positions.
please, no svg
Something like this:
Here is my code so far: (BUT it is NOT responsive, lines are NOT transparent, only good thing is that you can change lines easily with px and %):
background: linear-gradient(white, white),
linear-gradient(white, white), linear-gradient(white, white),
background-position: 90% 90%, 55% 75%, 90% 10%, 95% 30%, 90%;
background-size: 124px 20px, 153px 20px, 124px 20px, 153px 20px, 80px 20px;
Draw a circle with four horizontal empty stripes/lines inside the circle in CSS
% in place of
transparent instead of
There will be more to it than that, as in its current state that will just show the black which covers the whole circle, you will need to redesign how the gradients work to use transparent.
Think of creating the inverse image, adding the black bits instead of the white bits.
No possibility to do it that way Sam. I want to make them transparent, no invisible. Probably, I have to use something different than gradient. But I really do not know what.
It can works just like I say
In your example code you have a black background and add white blocks to it.
What you must do instead is use the exact same method to have a transparent background and add black blocks to it.
I have never tried it, but from the examples it looks like transparent and alpha channel could be used.
CSS gradients are represented by the data type, a special type of made of a progressive transition between two or more colors. You can choose between three types of gradients: linear (created with the linear-gradient() function), radial (created...
Hi there matthew4773,
try it like this…
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1">
<!--<link rel="stylesheet" href="screen.css" media="screen">-->
font: 1em/160% verdana, arial, helvetica, sans-serif;
background-image: linear-gradient( to right, #fff 0, #fff 60%, transparent 60%, transparent 100% ),
linear-gradient( to right, #fff 0, #fff 65%, transparent 65%, transparent 100% ),
linear-gradient( to right, transparent 0, transparent 15%, #fff 15%, #fff 85%, transparent 85% ,transparent 100% ),
linear-gradient( to right, transparent 0, transparent 35%, #fff 35%, #fff 100% ),
linear-gradient( to right, transparent 0, transparent 25%, #fff 25%, #fff 100% );
background-size: 100% 2vw;
background-position: 0 4vw, 0 9vw, 0 15vw, 0 21vw, 0 26vw;
:duh: Fixed dimensions are not responsive. Even though you were given responsive code in the previous thread, it doesn’t look like you’ve tried to incorporate it into your code.
Our fault, of course.
The next big question: Why the transparency? What will be visible behind those transparent lines?
It’s a pain in the derrier to try to work when relevent information is withheld.
It may be possible by using clip-path masks with polygon shapes but as Ron said we really need to know the whole story.
I’m sure svg could do it also but you don’t seem to want svg.
I would probably do it using a large transparent gif turned into a data uri as a background image as the simplest approach.
Of course if the transparent gaps need to be controlled independently then svg or clip path masks are probably the best bet although I haven’t tried either yet:)
This is it using the method I described:-
SVG is exactly the way to do this.
There’s more than one way to skin a cat though
And another a little simpler and easier to animate and change each line.
Sam!!! I don’t know how to thank you! This is it. You are css expert
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.