Does “display:none” prevent an image from loading?

前端 未结 17 2144
再見小時候
再見小時候 2020-11-22 05:13

Every responsive website development tutorial recommends using the display:none CSS property to hide content from loading on mobile browsers so the website load

17条回答
  •  忘了有多久
    2020-11-22 05:45

    The background-image of a div element will load if the div is set do 'display:none'.

    Anyway, if that same div has a parent and that parent is set to 'display:none', the background-image of the child element will not load. :)

    Example using bootstrap:

    
    
    
    
    lg
    md
    sm
    xs

提交回复
热议问题