Bootstrap 3 responsive h1 tag

前端 未结 3 740
萌比男神i
萌比男神i 2021-02-14 00:46

I am creating a site and want it to be responsive so I am using bootstrap 3. However, the h1 tag on the privacy policy page and about page come out of the container on small mob

3条回答
  •  天命终不由人
    2021-02-14 01:19

    You can use this :

    CSS :

    h1{
         word-wrap: break-word;
         -webkit-hyphens: auto;
         -moz-hyphens: auto;
         -ms-hyphens: auto;
         -o-hyphens: auto;
         hyphens: auto;
    }
    

    DEMO : http://jsfiddle.net/ckq04r5q/

    Or if you want more browser compatibiliy you can sibling your h1 with id or class and reduce font-size with media query on < 768px

    CSS :

    @media screen and (max-width: 768px) {
        h1{
            font-size:14px;
        }
    }
    

    When your screen as less to 768px of width the property has running

提交回复
热议问题