randomuser1
randomuser1

Reputation: 2803

How can I set the correct position of the text in CSS?

I have the following css code:

#content{
  position: fixed;
  bottom: 21px;
  text-align: right;
}

#content h1{
  font-size: 1.5vw;
  text-align: right;
}

and html:

<html>
    <head>
    </head>            
    <body>
        <div id="content">
            <h1>content</h1>
        </div>
    </body>
</html>

here's jsfiddle. I cannot make the text to be displayed on the right side, it's only on the left side... How can I fix it? Thanks.

Upvotes: 1

Views: 50

Answers (1)

potashin
potashin

Reputation: 44601

Set container's (#content) width css property to 100%.

JSFiddle

Upvotes: 4

Related Questions