qwertymk
qwertymk

Reputation: 35344

css center a fixed div with no overflow

I'm trying to center a fixed div on the top of a page with no overflow.

I can't seem to get the overflow working properly

Here's what I have so far

As you can see, I don't want the entire top to be white, just the part that's not inner

Is there any way to do this?

Upvotes: 0

Views: 87

Answers (1)

KBN
KBN

Reputation: 2984

If you want, only "#inner" to be white, change your CSS to :

#inner {      
    display: inline-block;
    background-color:white;
}

if you want only #inner to be yellow, then :

CSS

#inner {      
    background-color:white;
}
.yellow {
    background: yellow;
}

HTML :

<div id="inner"><span class="yellow" >Loading</span></div>

Upvotes: 2

Related Questions