javascript - 调整大小时自动调整字体大小

标签 javascript html css

我只是想问一下如何在调整大小时使字体大小响应性地改变(如缩放效果无剪切)?我得到了 bootstrap.css、jquery.js 和 bootstrap.js

<div class="full-width1">   
            <div class="container">
            <h1 class="firstinfo">About SWA{PRO}SE</h1>
            <p class="desc">The Software and Web Application Professionals and System Engineers (SWAPROSE) is a team of IT experts with vast experience in intranet business software, web application and game development.</p>          
            </div>   
        </div>

        <div class="full-width2"> 
          <div class="arrow-white"></div>
            <div class="container">
            <h1 style="color:#1798AA; font-weight:bold">Project Development</h1>
            <p class="desc">Swaprose provides a variety of project developments, from games to software. we create the applications need for our clients. We also create independent mobile games to be released on Android and iOS.</p>
            </div>     
        </div>
    </div>

enter image description here

最佳答案

Auto adjust font size when resizing

您可以使用 vw 单位来做到这一点:

h2 {font-size: 8vw;}

See this example

兼容性: http://caniuse.com/#search=vw

关于javascript - 调整大小时自动调整字体大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37145745/

相关文章:

javascript - Angular ng-view : show after hidden

javascript - 使用 ramda 按变量升序/降序

javascript - jQuery 触发器 ("click") 不工作

html - Google 字体不支持 CSS?

javascript - 如何更改使用 jQuery 加载的 html 中的值?

javascript - AngularJS动画自下而上

javascript - 新的正则表达式。测试

javascript - 无法在 React Js 中工作的 Chart js 中获取条形图颜色

javascript - 如果它调用 Selenium 中的 java 脚本函数,我如何从 Web 元素获取文件 URL

javascript - 使用 Jquery $ ("a[href*=' .sometext']") 传递变量而不是静态字符串