Here is the picture i need to embed in the website!我想將圖片放在文本旁邊,但我不知道如何調整邊距以使文本浮動到左側而不會在旁邊留下大的空白區域。另外,可能是因爲圖片太大,網頁不斷超出屏幕區域,瀏覽器會給我滾動條。我應該如何解決這個問題?如何在不超過屏幕的情況下將圖片放在文字旁邊?
我希望它看起來像這樣的網站:http://alexbudak.com/#first
這裏是我的代碼:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title> Larry Rosenburg Official Website </title>
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Anton|Crimson+Text:400,700,700i|Rakkas" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Cherry+Swash|Cinzel|Gentium+Basic|Muli" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Arsenal" rel="stylesheet">
</head>
<body>
<header>
<div id="logo">
<img src ="lincoln.jpg" width ="30%" alt="Lincoln logo" id="logo_picture">
<nav>
<ul>
<li> <a href="index.html"> Home </a> </li>
<li> <a href="lincoln.html"> Lincoln </a> </li>
<li> <a href="about.html"> About </a> </li>
<li> <a href="contact.html"> Contact </a> </li>
</ul>
</nav>
</div>
</header>
<div id="name">
<p>
Larry Rosenburg
</p>
</div>
<div id="profile-pic">
<img src="placeholder.jpg" width="30%" alt="" >
</div>
</body>
<footer>
</footer>
</html>
這裏是CSS:
#logo_picture{
margin-left: 80px;
}
#logo img, #logo nav{
float: left;
}
#logo nav{
line-height: 120px;
margin-left: 250px;
}
nav ul{
list-style: none;
margin: 0 10px;
padding: 0;
}
nav li{
display: inline;
}
nav a{
color: black;
font-size: 20px;
font-family:'Arsenal', 'sans-serif';
font-weight: 300;
padding: 2px 38px;
text-decoration:none;
}
nav a, nav a:visited {
color: black;
}
nav a.selected, nav a:hover{
color: grey;
}
#name{
margin: 100px 500px 0 10%;
font-size: 59px;
font-family: 'Anton', 'sans-serif';
float: left;
max-width: 500px;
}
#profile-pic{
margin: 0;
padding: 0;
}
它不與我的頭工作。有沒有辦法調整邊距來定位它們? – Kat
你的標題在哪裏?他們是誰」? –
這裏是一切: – Kat