Changing HTML from CSS media query

后端 未结 4 1374
不知归路
不知归路 2021-02-04 11:47

I have a situation in which I want to change an HREF in an unordered list in HTML when a CSS media query is true. Specifically I want to change an HREF from calendar.html to ca

4条回答
  •  日久生厌
    2021-02-04 12:28

    The question to ask is: How will the hidden content be used.

    The display CSS property hides HTML that is already built. If you have mobile, tablet, and desktop HTML, the application can be building HTML and applying CSS 3x while only displaying once.

    If it will be turned on and off, display works. If it will use either a mobile or a tablet or a desktop display and never use the others, using Javascript to add the content is better.

    Note that AngularJS has ngIf and ngSwitch directives that accomplish that only using HTML attributes.

提交回复
热议问题