I would like to create an rectangular overlay where the border is semi-transparent and the inner area is not transparent.
If I tweak the opacity parameter of the outer div (that contains the border) – than all the internal elements become transparent as well, which is unwanted.
Please advice.
Try this instead of using opacity, if you are alright with using CSS3:
That should give you solid red that is 50% transparent. Check out this intro to rgba if you want more info.
EDIT
If you aren’t using an actual border, note that rgba can be used in any place where CSS expects a color, like background-color.