Yesterday I posted a question about how to move a subhead in an svg image at Change the x-y coordinates of svg text with a media query in either css or javascript?. The answer was to insert the section between the style tags below. I want to move a subhead down and left.
So I implemented this, but the subhead does not move.
<div class="logo">
<style>
@media(max-width: 320px){
#subHead{
transform: translateX(70px);
transform: translateY(70px);
}
}
@media(min-width: 1000px){
#subHead{
transform: translateX(0px);
transform: translateY(0px);
}
}
</style>
<svg viewBox="0 0 240 220" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="MyGradient">
<stop offset="5%" stop-color="rgb(71,164,71)"/>
<stop offset="95%" stop-color="white"/>
</linearGradient>
</defs>
<text x="0" y="25" class="logo_class three">Main Head</text>
<text id="subHead" fill="url(#MyGradient)" x="24" y="33" width="33" height="24" class="tagline_class fadeIn animate_behind">subHead</text>
</svg>
</div>
Why doesn’t the transform work as written at the 320 media query? This is an avg image.
EDIT: this question was marked as duplicate, but that post is about applying multiple transforms. This is about one transform, to move the X and Y coordinates. That can also be accomplished with translate(70px, 70px) which is a single statement. So my question is not about multiple transforms.