I need some advice on using CSS; I’m very much an amateur programmer and only have a basic knowledge of CSS. The following code is on one of my website pages:
Code:
<div>
<img src="xxx.jpg" style="width:58%">
<img src="yyy.jpg" style="width:40%">
</div>
I am placing pairs of images side-by side with commentary. This occurs a dozen or more times on each page, so it can be tedious to edit the two percentage numbers. Currently I adjust the first image width, then make a corresponding change in the second so the total is 98%; this allows me control over appearance with a small but useful border between the images and the second one never being squeezed out to fall under the first. I don’t care what the image heights are, only the widths. I minored in math but am crappy at arithmetic, so I hated calculating what the second width must be. I am hoping that some clever CSS will allow the second image to automatically fill in the remaining space, but so far nothing I’ve tried works. If there is no way, perhaps someone can suggest a Javascript solution; I haven’t studied that language yet, so any suggestion there will have to be simple.
Many thanks for whatever comments I can get!