3

In the index file I have this :

<div id="head">
<h1>bla bla bla bla bla bla</h1>
</div>

And I style it like this:

#head{
  height : 100px;
  width : 100%;
  overflow:hidden;
  background-color: #FFCC99;
}


#head h1 {
  margin-left : 20px;
  font-family : Georgia;
  font-size : 40px;
}

The problem is that when the screen is too small the end of the text goes under like this:

bla bla bla bl
a bla bla

and what I want to happen is just to fade awaya like :

bla bla bl

and the rest of the text just not to be shown untill the screen is resized again.

3 Answers 3

3

You need to add this to your h1 css:

white-space: nowrap;
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks I tried this beacuse it looks simplier and now it's just as I wanted it.
3

add

overflow: hidden;
width: 100px; /*or whatever width you want*/

to your <h1>css statement.

It will not hide anything as you haven't told it what size width you want to hide from? Setting the width will allow you to accomplish this.

Comments

0
#head{
            height : 100px;
            width : 100%;
            overflow:hidden;
            background-color: #FFCC99;
        }
        #head h1 {
            margin-left : 20px;
            font-family : Georgia;
            font-size : 40px;
            white-space: nowrap;
        }

<div id="head">
<h1>bla bla bla bla bla bla</h1>
</div>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.