我目前正在研究我的第一個響應式網站,我也希望在智能手機上看起來不錯。我的問題是圖片/標誌放在線下,標題放在線上(請參閱下圖)。這可能怎麼做?智能手機上的Html header奇怪位置
HTML:
<body>
<div class="header">
<img src="Image link"/>
<h3>Title</h3>
<div class="navbar"> </div>
</div
</body>
CSS:
body,html {
margin: 0;
background-color: #fff;
font-family: Verdana, Georgia, serif;
font-size: 14px;
overflow-x: hidden;
}
.header {
margin: 0;
background-color: #363636;
height: 6em;
text-align: left;
font-size:150%;
}
.header img {
margin-left: 3em;
max-height: 4em;
max-height: 4em;
height:auto;
display:inline;
position: relative;
top: 25%;
-webkit-transform: translateY(+25%);
-ms-transform: translateY(+25%);
transform: translateY(+25%);
}
.header h3{
text-decoration: none;
color: #fff;
display: inline;
font-size: 250%;
text-align: left;
font-family: "Century Gothic";
margin: 0;
margin-left: 1em;
margin-top: 0;
position: relative;
top: -50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
min-width: 500px:
}
.header h3 a{
color: #fff;
}
目前會是什麼樣頁像智能手機(HTC Desire HD的:480×800):
它應該是什麼樣子:
它目前看起來如何在PC上。
這看起來像答案... upvoted .. –
完美的作品,在探索,Chrome和我的手機。這是我的問題的答案。我知道我的代碼非常混亂,我只是嘗試了不同的東西,直到它看起來像我想要的,我需要更深入地思考我想:) – RasmusGP