As all switchports are in vlan 1 (by default), the flooding is very notorious because we have one broadcast domain. But when you configure vlans and ports associated to each vlan, we have many broadcast domain of less size.
Then, if we have a broadcast packet that ingress in an access port in vlan 10, then, it will flood the packet to all switchports in vlan 10 except the one it rode in on and except another switchports that belongs in another vlans.
In Cisco press page
Network with VLANs
As shown in Figure 3-6, the network has been segmented using two VLANs. Faculty devices are assigned to VLAN 10 and student devices are assigned to VLAN 20. When a broadcast frame is sent from the faculty computer, PC1, to switch S2, the switch forwards that broadcast frame only to those switch ports configured to support VLAN 10.
Figure 3-6 Broadcasts with VLAN Segmentation
The ports that comprise the connection between switches S2 and S1 (ports F0/1), and between S1 and S3 (ports F0/3), are trunks and have been configured to support all the VLANs in the network. Port F0/18 is associated with VLAN 20, so S2 forwards the broadcast out port F0/1 but does not forward the broadcast out port F0/18, as shown in Figure 3-6.
When S1 receives the broadcast frame on port F0/1, S1 forwards that broadcast frame out of the only other port configured to support VLAN 10, which is port F0/3. When S3 receives the broadcast frame on port F0/3, it forwards the broadcast frame out of the only other port configured to support VLAN 10, which is port F0/11. The broadcast frame arrives at the only other computer in the network configured in VLAN 10, which is faculty computer PC4.
When VLANs are implemented on a switch, the transmission of unicast, multicast, and broadcast traffic from a host in a particular VLAN is restricted to the devices that are in that VLAN.