Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

simple CSS question

Tags:

css

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.

like image 650
Leron_says_get_back_Monica Avatar asked Jul 22 '26 04:07

Leron_says_get_back_Monica


2 Answers

You need to add this to your h1 css:

white-space: nowrap;
like image 195
DA. Avatar answered Jul 23 '26 17:07

DA.


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.

like image 28
Michael Avatar answered Jul 23 '26 19:07

Michael