Jump to content
Novadia

Hello! Is there any way to add class to a specific svg?

Recommended Posts

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! (:

Share this post


Link to post
Share on other sites

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').

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...