Resizing Headings when Window Size Changes

前端 未结 2 1529
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-20 03:33

I\'m currently working on a website where I need to put some images and some heading and description will be going along with it. If the browser is full screen, the heading

2条回答
  •  青春惊慌失措
    2021-01-20 04:10

    You can do it with css @media operator:

    h1 {
        font-size: 30px;
    }
    
    @media screen and (max-device-width : 400px)
    {
      h1
      {
        font-size:20px;
      }
    }
    
    @media screen and (min-device-width : 600px)
    {
      h1, div, etc
      {
        /* any css rules */
      }
    }
    


    Also check useful resources:
    auto resize text (font size) when resizing window?
    http://alistapart.com/article/responsive-web-design
    http://www.w3.org/TR/css3-mediaqueries/

提交回复
热议问题