5

Original

I am new to CSS, how i can make the div stay at the center of the page like this?

Desired

<div class="container"> <div class="row"> <div class="col-md-2"> </div> <div class="col-md-8 center-block"> <img class="img-responsive" id="MainCharacter" src="../Images/test_character.png" /> </div> <div class="col-md-2"> </div> </div> </div> 
0

1 Answer 1

3

Use CSS similar to this:

.container{ position: relative; } .row { position: absolute; top: 50%; transform: translateY(-50%); } 

A possible problem is that this code will apply to all .container's and .rows. You could add an id to them and select it using that id.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.