首頁 web前端 html教學 HTML如何製作百度首頁?代碼是什麼

HTML如何製作百度首頁?代碼是什麼

Oct 20, 2018 pm 02:17 PM
html 程式碼

這篇文章帶給大家的內容是關於HTML如何製作百度首頁?程式碼是什麼,有一定的參考價值,有需要的朋友可以參考一下,希望對你有幫助。

製作百度首頁時候,除了要用到p進行分塊,還需要對快的位置進行控制,一般有

對p進行規範大小width,height分別對應寬度高度

margin:有對p進行定位有margin-top,margin-left,margin-right,margin-buttom

float-left:吧p元素進行從左到右排列

了解這些簡單的操作之後,就可以自己做一個簡單百度頁面了,例如:

HTML如何製作百度首頁?代碼是什麼

上面的頁面html程式碼如下:

 
 <html>
<head>
	<title>百度一下,你就知道</title>
	<link href="baidu.ico" rel="shortcut icon" type="ico图标路径"/>
	<style>
	.p_head{
			width:100%;
			height:150px;
			
			margin-top:0px;
	}
	
	.p_mid{
			width:100%;
			height:130px;
			
			margin-top:0px;
	}
	.p_body{
			width:100%;
			height:200px;
			
			margin-top:0px;
	}
	.p_base{
			width:100%;
			height:60px;
			
			float:left;
			margin-top:0px;
	}
	.p_based{
			width:100%;
			height:100%;
			
			float:left;
			margin-top:0px;
			
	}
	
	
	.p_head1{
		width:540px;
		height:24px;
		
		float:right;
		margin-top:25px;
		
	}
	.p_head2{
			width:50px;
			height:24px;
			
			float:left;
			line-height:24px;
			text-align:center;			
	}
	.p_mid1{
			width:270px;
			height:130px;
			
			float:left;
			
			margin-left:39%;
	}	
	.p_body1{
			width:600px;
			height:36px;
			background-color:#999;
			float:left;
			
			margin-left:32%;
	}	
	
	.p_base1{
			width:60px;
			height:60px;
			margin:0 auto;
			float:left;
			margin-top:5%;
	}
 
	</style>
</head>
<body style="margin:0 auto">
	<p class="p_head" >
			<p class="p_head1">
					<p class="p_head2" ><font size="1" ><ins>新闻 </ins></font></p>               
					<p class="p_head2" ><font size="1" ><ins>hao123</ins> </font></ins></p> 
					<p class="p_head2" ><font size="1" ><ins>地图 </ins></font></p> 
					<p class="p_head2" ><font size="1" ><ins>资源 </ins></font></p> 
					<p class="p_head2" ><font size="1" ><ins>视频 </ins></font></p> 
					<p class="p_head2" ><font size="1" ><ins>贴吧 </ins></font></p> 
					<p class="p_head2" ><font size="1" ><ins>学术 </ins></font></p> 
					<p class="p_head2" ><font size="1" ><ins>登录 </ins></font></p> 
					<p class="p_head2" ><font size="1" ><ins>设置 </ins></font></p>
					<p class="p_head2" style="width:70px;background-color:#38f" ><font size="1" color="white" >更多产品</font></p> 
			</p>
	</p>
 
	<p class="p_mid" >
	
		<p class="p_mid1" >
			<a href="https://www.baidu.com/s?wd=%E7%BD%91%E7%BB%9C%E8%A1%A8%E6%83%85%E7%AC%A6%E5%8F%B7%E8%AF%9E%E7%94%9F&sa=ire_dl_gh_logo&rsv_dl=igh_logo_pcs" target="_blank">
				<img  src="/static/imghw/default1.png"  data-src="https://www.baidu.com/img/bd_logo1.png?where=super"  class="lazy"   height=130    style="max-width:90%"百度一下你就知道"/ alt="HTML如何製作百度首頁?代碼是什麼" >
			</a>	
 
		</p>
	</p>
 
	<p class="p_body" >
			<p class="p_body1" >
					<form action="https://www.baidu.com/s"  method="get"  >
					<input style="width:500px;height:36px;"type="text"/><input id="gender" name="gender" type="submit"  value="百度一下"style="width:100px;height:36px;"/>	
					</form>
			</p>
	</p>
	
	<p class="p_base" >
				<p class="p_base1" style="margin-left:48%;">
						<img  src="/static/imghw/default1.png"  data-src="https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/home/img/qrcode/zbios_efde696.png"  class="lazy"   height=60    style="max-width:90%"我是一个二维码"/ alt="HTML如何製作百度首頁?代碼是什麼" >
				</p>
	</p>
	
	
</body>
</html>
登入後複製

以上就是對HTML如何製作百度首頁?程式碼是什麼的全部介紹,如果您想了解更多有關HTML影片教學,請追蹤PHP中文網。

以上是HTML如何製作百度首頁?代碼是什麼的詳細內容。更多資訊請關注PHP中文網其他相關文章!

本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

HTML 中的表格邊框 HTML 中的表格邊框 Sep 04, 2024 pm 04:49 PM

HTML 表格邊框指南。在這裡,我們以 HTML 中的表格邊框為例,討論定義表格邊框的多種方法。

HTML 中的巢狀表 HTML 中的巢狀表 Sep 04, 2024 pm 04:49 PM

這是 HTML 中巢狀表的指南。這裡我們討論如何在表中建立表格以及對應的範例。

HTML 左邊距 HTML 左邊距 Sep 04, 2024 pm 04:48 PM

HTML 左邊距指南。在這裡,我們討論 HTML margin-left 的簡要概述及其範例及其程式碼實作。

HTML 表格佈局 HTML 表格佈局 Sep 04, 2024 pm 04:54 PM

HTML 表格佈局指南。在這裡,我們詳細討論 HTML 表格佈局的值以及範例和輸出。

HTML 輸入佔位符 HTML 輸入佔位符 Sep 04, 2024 pm 04:54 PM

HTML 輸入佔位符指南。在這裡,我們討論 HTML 輸入佔位符的範例以及程式碼和輸出。

HTML 有序列表 HTML 有序列表 Sep 04, 2024 pm 04:43 PM

HTML 有序列表指南。在這裡我們也分別討論了 HTML 有序列表和類型的介紹以及它們的範例

在 HTML 中移動文字 在 HTML 中移動文字 Sep 04, 2024 pm 04:45 PM

HTML 中的文字移動指南。在這裡我們討論一下marquee標籤如何使用語法和實作範例。

HTML onclick 按鈕 HTML onclick 按鈕 Sep 04, 2024 pm 04:49 PM

HTML onclick 按鈕指南。這裡我們分別討論它們的介紹、工作原理、範例以及各個事件中的onclick事件。

See all articles