Prevent H1 Label Break To New Line

I am creating a dynamic webpage using a framework. Everything flawlessly goes to phones and tablets. However, I create this on a 1920 x 1080 monitor. And when I tested it on a 1280 x 1024 monitor, my H1 logo and h2 slot broke.

I am not sure how to fix this. Here is my CSS and HTML.

    /*Header*/

#Header{
     max-height:106px;
     min-height:105px;
     background-color:#666666;
     border-bottom-width:3px;
     border-bottom-style:solid;
     border-bottom-color:white;


}

#logo{

    max-height:106px;

    border-right-width:3px;
    border-right-style:solid;
    border-right-color:white;
    line-height:none;
    text-align:center;
    background-color:#f58026;
}

#logo h1{
    margin-top:10px;
    font-weight:400;
    font-family:'Gill Sans MT';
    font-size:2em;
    margin-bottom:0px;
}

#logo h2{

    margin-top:0px;
    font-weight:500;
    font-family:'Myriad Pro' ,Arial;
    font-style:italic;
    color:white;
    font-size:1em;
    padding-bottom:15px;
}

<div class="row collapse" id="voipHeader">

    <!--Logo-->
    <div id="logo" class="large-2 columns small-12 columns">
        <h1></h1>

        <h2>Your Premier </h2>
    </div>

      <!--Navigation-->
    <div id="navigation" class="large-10 columns small-12 columns">
        <ul>
            <li><a href="#">Clients</a></li>
            <li><a href="#">About</a></li>
            <li><a href="#">Contact</a></li>
            <li><a href="#">Inquiry Form</a></li>
        </ul>

    </div>
</div><!--End Row-->
+4
source share
3 answers

If you want yours to h1break into multiple lines, you can use the following statement:

h1 { white-space: nowrap; }

This only works in browsers that support CSS3, and you may need to set the property overflowin the containing element.

, . h1 .

@media CSS , div , .

+13

CSS:

#logo h1 {
    white-space: nowrap;
}

:

<h1>VoIP&nbsp;Innovations</h1>

&nbsp; - HTML " ". , .

+3

Use white-space:nowrap;to achieve what you are looking for.

For instance

#logo h1 {
   white-space: nowrap;
   }
+3
source

Source: https://habr.com/ru/post/1528118/


All Articles