When it comes to HTML/CSS, they are essentially vector graphics. The CSS measurement unit "px" may be set at 72ppi, but this doesn't mean they are raster graphics. It's important to treat them as vectors by the printer software. If you notice lines, text, or other elements printed in a lower resolution like 72dpi, the issue likely lies with your printer/renderer software. Consider trying another browser or saving the document as a PDF (Chrome can do this easily).
However, remember that while the CSS unit "px" is 72ppi, raster graphics such as png, jpg, and gif images will also be treated as 72ppi, even if they were saved in a different resolution. To adjust the resolution of an image accurately, you may need to resize it accordingly. For example, if you have a 5x5 centimeter image (=2x2 inches), save it as 600x600px, but set its CSS width property to 144px (using the formula: width*(72/300)) so it appears correctly on the website.
If images are resized properly, you should have no trouble printing them at 300dpi, especially when saved as a pdf first. Otherwise, the issue likely lies with the printer or printer software.
Remember, the web is not print, and there will always be differences between how a webpage looks on screen versus in print - and that's okay. If you require exact replication, opting for a PDF format may be the best solution.