i can only get size to stays within a container that has a fixed size (1000px for instance)
but i can’t get it to be something relative, so when the size of the screen changes, the container size also changes.
if there is anybody who knows more on how to do it, i can use some help.
You can use the lesser known “viewport width/height” setting which I think works similar to e.g. width: 100%; but instead adapts the size of your divs to the browser window size:
width: 90vw; which works if you combine it with overflow, for example overflow-x: auto;.
Also here’s a nice tutorial if you want to try out the more advanced scrolling options I mentioned (section about “Sticky rows and columns”):
@sanojjonas,
I tried on my screen and for your 2 div#bottom1 and div#bottom2 in artist page, I have set width: 76vw; instead of width: auto;.
It’s the maximum value I could set before altering MB split width between content and sidebar.
I don’t know if it’s same on others’ screens.
And overflow-x: auto; is already set, no changes needed.
Weird, maybe it’s a browser thing, I use firefox and screen width 1920 (but that shouldn’t matter). If I set it to 90vw the userscript divs have the same width as the MB release group div above it and they both have the same width until you make the browser window width very small.
Ach, so, maybe it’s not that easy or there is a better way.
Note: I was on Windows Vivaldi with zoom at 100% (no zoom), and whatever my window size was, things were following the main content width nicely, without tampering MB layout, with width: 76vw.
At 90ew, main content column got enlarged and sidebar got pushed further rightwards.
Now I think that we have to have a look at the styling of the release group tables, and mimic them.
Another long-wanted feature that this implements is showing links to all the bands someone is a member of, without first clicking through to the relationships tab:
the line isn’t there because of css from the music brainz website itself (it will get a line when you hover it.
i changed the colors of the to black (with a white hover state) because with the colors sometimes the contrast made it difficult to read.
but in the latest version, i removed this css. so urls should look the same as other music brainz urls
Sorry, I break things cos I test different. Here we have a band where there are joining dates for all, but no leaving dates as they are all still there.
Can I point this example your way to do a bug fix with as none of them are appearing in the graph. Is this because they lack instruments, or the way the date is done?
Yep 100% zoom no screen scaling in Windows. The userscript table div is 1459px which is 76% of 1920. Maybe you have a laptop with screen scaling enabled? I tested on my laptop and the div does become wider and I get similar/same result as you with 76vmax if I use the recommended 150% scaling in Windows 10 with 100% browser zoom.
But yeah it’s not an optimal solution. On the relationship tab I now need to change the value to 85 (instead of 90 on the overview tab) to match the width of the table above it (1632px which is 85% of 1920) and if I go above that it breaks the layout. The zoom thing is also annoying but that’s apparently by design. Keeping it at a lower value is probably for the best.