Click here to Skip to main content
15,902,112 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am designing a html page.link https://codepen.io/KARANVERMA5/pen/oqKJma .
I need to have the button and progress bar all aligned to center and shows behind the word-cloud.
Please point me in right direction that what is wrong here, why the bar is not showing below the word-cloud. How can I show wordcloud at top and all other things divs below it centered?

What I have tried:

    #word-cloud  {
    position:fixed;
    height: 100vh;
    max-height: 100%;
    width: 100vw;
    max-width: 100;
    margin:-300px auto auto -250px;
    top:20%;
    left:70%;
    text-align:center;
    z-index:1;
}

body,
html {
    margin: 0;
    padding: 0;
}


.bar {
    position:relative;
    border: 1px solid #666;
    height: 5px;
    width: 100px;
    margin:-300px auto auto -250px;
    z-index: 2;
}

.bar .in {
    -webkit-animation: fill 10s linear 1;
    animation: fill 10s linear 1;
    height: 100%;
    background-color: red;
}

@-webkit-keyframes fill {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}
Posted
Updated 19-Apr-18 2:09am

1 solution

I can give you some definite pointers - which is the best way for you to learn.

1 - look at CSS styles: z-index to control layers. What orders the values? How?
2 - centering div's and the like: margin: 0 auto 0 auto; is the trick for that.
It's telling the browser no top/bottom margins, automatic right and left margins.
3 - if you're overlaying things, they still really need a container. Again, a style,
background-color:transparent;

I work mainly with <div> elements for everything. I even make buttons that way, at times, with an on-click event or link. More flexability. You can get rid of the line under the link text if you wish.

You'll still need to play around with these - which is the learning part.

 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900