A district court has blocked the enforcement of a law passed in Texas that would have limited online access to minors.