Novadia Posted August 3, 2017 Share Posted August 3, 2017 Hello! Is there any way I can add a specific class to svg tag? I try to do that: .svgclass{ stroke: lightblue; stroke-width: 2px; display:inline-block; position:absolute; z-index:1; right: 0px; top: 10px; margin:0px 0px 0px 0px; padding:0px 0px 0px 0px; height:80px; width:1px; } And in the body: <svg class="svgclass"><line x1="0" y1="0" x2="0" y2="80" /></svg> This is not work... (And the svg style is set good, cause when I remove the class from the svg, and change in the css file to svg its all great..) Thanks! (: Link to comment Share on other sites More sharing options...
dsonesuk Posted August 3, 2017 Share Posted August 3, 2017 There is no reason you can't add a css classname or id to svg element, in fact there are svg css properties specifically for svg usage (just google 'svg css properties'). Link to comment Share on other sites More sharing options...
PHPremote Posted June 3, 2020 Share Posted June 3, 2020 First, your "display:inline-block;" may contradict your other position data. Second, the examples I have seen so far put the height and width in the tag definition, as in <svg width="200" height="200" class="svgclass" ></svg> . Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now