見我jsfiddle demo。
通過使用col-sm- *和col-md- * classnames,我假設你使用的是Twitter Bootstrap CSS Grid。
雖然我注意到你的工作有幾個問題。你有一個style =「width:700px;」和您的<h1>上的「col-sm-8」課程。您還嘗試在您的<img>上使用「col-md-4」類,而不是在包裝<div>上使用它。
我想請您看看我的小提琴代碼和Bootstrap CSS Grid docs(向下滾動,並期待在代碼樣本。)
HTML
<h2>Example 1</h2>
<p>2-column grid, using Bootstrap CSS Grid (12-column grid). <strong>col-sm-4, col-sm-8</strong></p>
<hr>
<div class="container" style="margin:0 auto;">
<div class="row">
<div class="col-sm-4">
<img alt="DDP" style="width:140px; height:60px;" src="logo.png" />
</div>
<div class="col-sm-8">
<h1>Monitoring Engineering Dashboard</h1>
</div>
</div>
</div>
<hr>
<h2>Example 2</h2>
<p>2-column grid. Tip: Adjust your browser window to see in real-time the side-by-side layout activate, for col-md-* grid sizing. This also means that if your browser window is anything under 991px, then the column layout will display the columns as stacked blocks (rows). <strong>col-md-4, col-md-8</strong></p>
<hr>
<div class="container" style="margin:0 auto;">
<div class="row">
<div class="col-md-4">
<img alt="DDP" style="width:140px; height:60px;" src="logo.png" />
</div>
<div class="col-md-8">
<h1>Monitoring Engineering Dashboard</h1>
</div>
</div>
</div>
<hr>
<h2>Example 3</h2>
<p>
2-column grid, flipped. <strong>col-sm-8, col-sm-4</strong>
</p>
<hr>
<div class="container" style="margin:0 auto;">
<div class="row">
<div class="col-sm-8">
<h1>Monitoring Engineering Dashboard</h1>
</div>
<div class="col-sm-4">
<img alt="DDP" style="width:140px; height:60px;" src="logo.png" />
</div>
</div>
</div>
<hr>