答案 0 :(得分:-1)
<!DOCTYPE html>
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Titillium+Web" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Satisfy" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/main.css">
<title>My Portfolio</title>
</head>
<body>
<div id="header">
<header>Mr. Philip Braun</header>
<img src="img/greeny.png">
<h1 class="hvr-float-shadow" style="text-align:center">About Me</h1>
<br>
<p> I'm a funny and classy guy from London<br>and i dare you to click "About Me"<br>because if you don't, you are missing your chance of knowing about a guy<br>who works hard for what he is made and of course doing it<br> <b>perfectly<b><br> <b>with finesse</b> </p>
</div>
<br><br>
<img class="braun" src="img/braun3.jpg">
</body>
</html>
&#13;
使用CSS,您可以应用text-align属性将元素设置为通过我提供的代码段中的内联方法居中,或者通过引用类或元素的内部或外部样式设置。
h1{
text-align:center;
}
答案 1 :(得分:-1)
<!DOCTYPE html>
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Titillium+Web" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Satisfy" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/main.css">
<title>My Portfolio</title>
</head>
<body>
<div id="header">
<header>Mr. Philip Braun</header>
<img src="img/greeny.png">
<center>
<h1 class="hvr-float-shadow">About Me</h1>
</center>
<br>
<p> I'm a funny and classy guy from London<br>and i dare you to click "About Me"<br>because if you don't, you are missing your chance of knowing about a guy<br>who works hard for what he is made and of course doing it<br> <b>perfectly<b><br> <b>with finesse</b> </p>
</div>
<br><br>
<img class="braun" src="img/braun3.jpg">
</body>
</html>
这是将文本居中的最简单方法。