1

I'm having trouble vertically centering both my text id="WhatIsMasterRow" and image id="WhatIsMasterPhoto. I've tried wrapping it in a .container and using the bootstrap center-block, as well as some other centering classes.

<!DOCTYPE html>
<html lang="en">    
<body>
    <!-- What is Master Page -->
    <div class="row" id="WhatIsMasterRow">
        <div class="col-md-6" id="WhatIsMasterText">
            <div class="row-text", id="SubHeaderTextLeft"> What is a Master? </div>
            <div class="row-text", id="RegularTextLeft"> Test Text  </div>
        </div>
        <div class="col-md-2 col-md-offset-2 center-text">
            <img id="WhatIsMasterPhoto" src="Resources/Images/Peter-Limmer-boots-2.jpg">
        </div>
    </div>
</body>

I've tried using margin: 0 auto; as well, but it's not working.

.col-md-2 {
    margin: 0 auto;
    background-color: black;
}
Josh Crozier
  • 233,099
  • 56
  • 391
  • 304
Tim
  • 741
  • 1
  • 10
  • 16
  • Please, create JSFiddle - that will speed up the process of helping You. :) – Mr.TK Mar 18 '14 at 05:48
  • possible duplicate of [How do you get centered content using Twitter bootstrap?](http://stackoverflow.com/questions/9184141/how-do-you-get-centered-content-using-twitter-bootstrap) – Sanoob Mar 18 '14 at 05:50
  • I've tried all the methods in the above thread, hasn't been able to work. I'll work on a JSFiddle in a bit, I'm trying a major overhaul right now. Experimenting with containers. Sorry for the delay and thanks for the intended help! – Tim Mar 18 '14 at 05:52
  • fix the width of the div to a desired value and set its margin from left to the middle of the page that you are designing... don't do margin:0 auto; 0 auto means that the top and bottom margins are 0 and the left and right margins are set automatically according to the width of the device on which the page is being viewed. make it margin: 0 something px; it will work for you – Utkarsh Singh Mar 18 '14 at 06:00
  • Ok here's the JSFiddle: http://jsfiddle.net/2LKXQ/1/. I'm just having trouble with the vertical align. Horizontal isn't a problem anymore. – Tim Mar 18 '14 at 06:24
  • New question: http://stackoverflow.com/questions/22471973/how-can-i-vertically-center-my-bootstrap-columns – Tim Mar 18 '14 at 06:35

0 Answers0