Skip to main content

All Questions

Tagged with
21 votes
1 answer
29k views

Responsive clip-path with inline SVG

On an element with a background (image or solid color don't really matter): <header id="block-header"></header> I am trying to apply a clip-path using SVG. To achieve this, I am putting ...
spliter's user avatar
  • 12.6k
124 votes
6 answers
165k views

How to make a <svg> element expand or contract to its parent container?

The goal is to have the <svg> element expand to the size of its parent container, in this case a <div>, no matter how big or small that container may be. The code: <style> svg, ...
user782860's user avatar
  • 2,789
21 votes
6 answers
68k views

Creating a diagonal line/section/border with CSS

I am trying to create a diagonal line on a webpage, to act as a section/section break. This is essentially a split colour section. I cant use an image as if the page gets enlarged, the image is going ...
Dom Greenslade BSc's user avatar
5 votes
6 answers
4k views

Center triangle at bottom of div full width responsively

After hours of trying in CSS (sorry, I'm still a CSS noob) I am asking you for help: I want a triangle to be the "bottom" of a div while filling the whole screen width, no matter what size the screen ...
lx4r's user avatar
  • 133
1 vote
2 answers
7k views

how to make svg responsive [duplicate]

I'm trying to make this massive svg responsive. However, it's not working and I don't know why. I tried the following: - setting width: 100% height: auto (the diagram disappeared as soon as I removed ...
CleverNode's user avatar
6 votes
2 answers
14k views

SVG Responsive Text

I have an SVG within a web page, it consists of images + text <object data="/infographic/timeline.svg" type="image/svg+xml"> <img src="/infographic/timeline.svg" alt="Timeline"> <...
Gaza's user avatar
  • 427
12 votes
2 answers
5k views

How to have multiple d3 window resize events

I have three svg elements on one page, each chaperoned by D3. Each one has its own page-resize logic assigned by a simple module I've written to make them responsive. The trouble is that only the ...
Chris Wilson's user avatar
  • 6,719
10 votes
1 answer
9k views

SVG container renders wrong size in Safari desktop (fine in Chrome/iOS)

I thought Safari had sorted this but it still seems to be an issue (unless I'm doing something obviously wrong). I have a SVG placed inside an object tag. That is wrapped in a flexible containing DIV ...
Ben Frain's user avatar
  • 2,578
7 votes
2 answers
3k views

SVG Preserve Aspect Ratio in Android

I am having issues of SVG Scaling on Android Phones. Couple of parts of my website are based on having both width and height dimensions for SVGs embeded via <img> tag. All the browsers except ...
Prashant Sani's user avatar
6 votes
4 answers
7k views

Diamond menu items using CSS and SVG

I want to code the below design in HTML&CSS What I made so far is: I made it using: a links SVG as background Absolute position and translate(x,y) property in CSS. Please check this fiddle for the ...
shadeed9's user avatar
  • 1,836
3 votes
2 answers
2k views

White line between an element and svg shape

Hi guys, i'm using svg shaper generated from shapedivider an how you can see, there is a white line and i don't why its there and how to remove it. Could you please help me? there is the code of the ...
user avatar
3 votes
2 answers
640 views

How to create responsive triangle as right border?

I am trying to make a responsive triangle for one border, which will be visible only on hover. I tried the below code but it doesn't work because it uses static border-width. When I have one-string (...
ostinred's user avatar
  • 116
2 votes
1 answer
620 views

Chrome: SVG container not rescaling responsively

I have an SVG that is effectively being used as a 'mask'; it's displayed over the top of another div with a background image so that the image peeks through the unfilled areas of the SVG. The SVG ...
indextwo's user avatar
  • 5,945
1 vote
2 answers
448 views

Responsive SVGs on InternetExplorer with SVG injection

To make SVGs responsive on our website with Internet Explorer 11 I am using the "Canvas Hack" by Nicholas Gallagher. This hack uses an extra canvas element to make use the SVG keeps the aspect ratio. ...
VickyB's user avatar
  • 190
1 vote
0 answers
1k views

React Native - SVG Image is not scaling across different device dimensions

I am trying to develop a simple screen in react native where it displays an svg image. I am trying to make the svg image use the full device width and height (100%). But the problem is, it is not ...
Saimuga's user avatar
  • 445

15 30 50 per page