已設置爲內聯塊上的圖像和H1標題:http://jsfiddle.net/
HTML:
<img id="image-surround" src="{{media url="wysiwyg/mintbar.png"}}" alt="" />
<h1>of WATCHES & MEN</h1>
<img id="image-surround" src="{{media url="wysiwyg/mintbar.png"}}" alt="" />
CSS:
#image-surround { display: inline-block;
}
h1 { display: inline-block;
}
當然,你需要有一個容器,它有一切正確的響應。 http://jsfiddle.net/qn8dnvmg/4/
HTML:
<div class="container">
<div class="columns onethird">
<img id="image-surround" src="{{media url="wysiwyg/mintbar.png"}}" alt="" />
</div>
<div class="columns onethird">
<h1>of WATCHES & MEN</h1>
</div>
<div class="columns onethird">
<img id="image-surround" src="{{media url="wysiwyg/mintbar.png"}}" alt="" />
</div>
</div>
CSS:
.container { position: relative;
margin: 0 auto;
padding: 0;
width: 960px;
padding-left: 10px;
padding-right: 10px;
}
.container .column, .container .columns { float: left;
display: inline;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding-left: 2px;
padding-right: 2px;
}
.row { margin-bottom: 20px;
}
.clear { clear: both;
height: 1px;
width: 100%;
}
.container .onehalf.columns { width: 50%; }
.container .full.columns { width: 100%; }
.container .onethird.columns { width: 33.33%; }
.container .twothirds.columns { width: 66.66%; }
.container .onequarter.columns { width: 25%; }
.container .twoquarters.columns { width: 50%; }
.container .threequarters.columns { width: 75%; }
.container .onefifth.columns { width: 20%; }
.container .twofifths.columns { width: 40%; }
.container .threefifths.columns { width: 60%; }
.container .fourfifths.columns { width: 80%; }
.container .oneeight.columns { width: 12.5%; }
.container .twoeights.columns { width: 25%; }
.container .threeeights.columns { width: 37.5%; }
.container .foureights.columns { width: 50%; }
.container .fiveeights.columns { width: 62.5%; }
.container .sixeights.columns { width: 75%; }
.container .seventeights.columns { width: 87.5%; }
.container .onetenth.columns { width: 10%; }
.container .twotenths.columns { width: 20%; }
.container .threetenths.columns { width: 30%; }
.container .fourtenths.columns { width: 40%; }
.container .fivetenths.columns { width: 50%; }
.container .sixtenths.columns { width: 60%; }
.container .seventhtenths.columns { width: 70%; }
.container .eighttenths.columns { width: 80%; }
.container .ninetenths.columns { width: 90%; }
然後你的媒體查詢等
你聽說過CSS的?這就是你將如何實現你的目標http://www.w3schools.com/css/default.asp – 2014-11-03 21:46:04
是的,但是我需要完成什麼CSS代碼? – user4182490 2014-11-03 21:56:01
這樣做很容易,但有多種考慮。該行會覆蓋整個頁面,還是僅包含內容區域? – 2014-11-03 21:58:08