如何正确地编写代码和样式



我很难像真实的一样正确地显示它。对,所以这是我的一段代码。您可以在各自的IDE上尝试此操作以查看页面因为基本上我不能在这里拖放图像。我使用的是html CSS,vs代码。它基本上就是谷歌的界面,中间有页眉、main、serach栏,底部有按钮和导航。我很难让它像一个真正的谷歌用户界面(只是个初学者。

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Google Login</title>
<link rel="shortcut icon" href="google-logo-png-29534-32x32.ico" type="image/x- 
icon">
</head>
<body>
<div id="header">
<a href="#">Gmail</a>
<a href="#">Images</a>
<img src="pad.png">
<img src="cs-logo.png">
</header>
<main>
<input type="search"> 
<img src="google-voice-search-icon.png">
<img src="googlelogo_color_272x92dp.png">
<button>Google Search</button>
<button>I'm feeling lucky</button>
</main>
<p>Google offered in: <a href="#">Filipino</a> <a href="#">Cebuano</p>
</div>
</body>
</html>

img标记中的属性src=""将从本地路径或URL获取图像。

例如,如果你想要涂鸦的图像,你有两个选择:

  • 从Google web下载图像,然后用以下内容覆盖img标记:<img src="/path/to/the/image.png"
  • 获取web中图像的URL(在这种情况下:https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png)然后用以下内容覆盖img标记:<img src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png"

我希望这能有所帮助。

最新更新