I’m using bootstrap to do my portfolio page. I have an image and text in the first section which looks fine on the laptop. When I view it on a phone the image goes teeny tiny and the text takes up multiple lines, starting underneath the image. I’ve got the text set to % but I’m guessing this is just doing % of the original text size, not % of the screen width.
Usually to make text responsive you can use @media queries, or set the font-size to a viewport unit such as:
font-size: 50vw; /* 50% of page width */
I do not know for sure, but I believe if you set the percent for font-size, it is % of inherited value which by default in most browsers is 14px or 16px. You can also use em and rem units which are based off the same thing, but are slightly different.
That’s what I’m getting on my phone (iPhone so using safari), but isn’t what I want. I just want the text to get smaller - and although it will split onto more than one line, I want it inline with the image. It’s also what I get if I resize both Chrome and Edge on my laptop
As far as I know this isn’t supported by all browsers, you could create a function that monitors the screen width and resizes elements accordingly, or you could just write some media queries that change text size where you want it to. I will be really nice when vm (viewport width) is standardized to the point that it becomes the standard.
If you would like to obtain something like the above image, you should set a different col-*-* value for small and extrasmall screens to both personal-photo and intro-text (something like 3+8 on xs and 2+10 on sm), then set a percentage margin-top to the intro-text (try different values and choose which better fits your feelings) and set to it a bit bigger font-size (I tried with 4.3vw).
That’s all (I tried it only with Firefox responsive test tool). I hope this could be helpful.