Styrofoam is a form of plastic that comes in a variety of different chemical formulations--just like any other plastic you might be trying to attach the Styrofoam to. In general, adhesives that are intended for use with non-porous materials will hold Styrofoam and plastic together relatively well, with hot glue being both effective and readily available. Keep in mind that no matter how strong an adhesive you use, the Styrofoam itself will remain relatively weak and break easily, usually well before the glued bond between it and the plastic breaks.
Things You'll Need
Hot glue gun
Set your hot glue gun to its lowest heat setting. This helps reduce the chance that the hot glue might burn a hole into the Styrofoam or plastic.
Apply the hot glue to the plastic surface you'd like to attach to the Styrofoam. Let cool for about three seconds.
Press the Styrofoam in place on the plastic surface. If the hot glue is too stiff for the Styrofoam to sit flush against the plastic, peel the cooled hot glue off--if you can--and try again, this time not waiting as long before placing the Styrofoam on the glue.
Weight the Styrofoam down, if necessary to achieve a tight seal with the plastic surface, with a book or simply by pressing down on it until the glue sets. This usually happens quickly, within a minute, but leaving a weight on top of the Styrofoam for about 10 minutes will help ensure the tightest seal possible.
If the Styrofoam doesn’t adhere to the plastic well, “scrub” the surface of the plastic you’re trying to adhere the Styrofoam to with 120-grit sand paper, brush away any residue, then try the glue application again.
Don’t use solvent adhesives on plastic or Styrofoam; they will release toxic fumes when they combine with the plastic.