Simple html css page production_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:06:05
Original
1194 people have browsed it

Today I will use html css to create the simplest page. The rendering is as follows:

Explanation: The Korean words here can be replaced with Chinese.

1. After getting the rendering, first analyze the page layout

The picture is a vertical structure, divided into 5 large DIVs:

The page width I made is 1024px , add a large box outside the 5 DIVs to a class named all. Set the width to 1024px and center it.

Generally, pages are done in order. This depends on personal habits. Since it is just one page, my css and HTML are written in the same page.

2. First write the first div and give it a class name top.

The css style is as follows:

The effect is as follows:

The first div is now ready.

3. Make the menu and logo below

css is as follows:

Rendering:

4. Make the submenu of menu

css is as follows:

Generally, the secondary menu can be made with js, I No JS is used here, CSS is used directly to position the first-level menu and the second-level menu, and the style (css in the rectangular frame in the picture) is used to control the hiding and display of the second-level menu. The disadvantage of writing this way is that it is not compatible with IE6. Other mainstream browsers like Google, Firefox and higher versions of IE are compatible.

5. It’s best to use banner, you can put pictures directly or set background.

is omitted here. 6. Analyze the main content. The fourth DIV

is divided into two layers. The first layer displays the news list, about us and product center, and the second layer displays logo copyright statement and a drop-down box

Because the content on the first layer is displayed side by side, these three DIV settings are like left floating.

In order from left to right, do the news section first

Style:

7. The picture is divided into left and right structures. Just let the picture float to the left, and the left and right structures will come out. I haven't encountered any problems with this way of writing yet.

The product center should be the shutter effect made with js. This is just the style for now. The effect will be added later. Add the bottom logo and other divs between the product center and the bottom logo and it will automatically go down.

The code is attached below:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>html+css基本页面</title><style type="text/css">*{ margin:0; padding:0; font-size:12px; color:#464646;}a{ text-decoration:none;}ul li{ list-style:none;}.clear{clear: both;font-size: 1px;width: 1px;height: 0px;visibility: hidden;overflow: hidden;}/*.clear样式的作用是清除浮动*/.all{ width:1024px; margin:0 auto;}.top{ background:#404040; display:table; width:100%;}.top ul{ float:right; margin-right:30px;}.top ul li{ float: left; margin:0px 10px;}.top ul li a{ display:block; color:#c2c2c2; line-height:30px; margin:10px 0px; width:75px; text-align:center;}.top ul li a.a_hover{background:url(images/topa_bg.png) no-repeat;}.top ul li a:hover{background:url(images/topa_bg.png) no-repeat;}.header{ background:url(images/menu_bg.jpg) repeat-x;}.logo img{ display:block; margin:0px auto; padding-top:20px;}.menu{ display:table; margin:0 auto;}.menu ul li{ float:left; position:relative;}.menu ul li.li_line{ width:2px; background:url(images/li_linebg.png) no-repeat; height:44px;}.menu ul li a{ display:block; line-height:44px; width:150px; text-align:center; color:#000; font-size:14px;}.menu ul li a.menua_hover{ background:url(images/menua_hover.png) no-repeat; color:#fff;}.menu ul li a:hover{ background:url(images/menua_hover.png) no-repeat; color:#fff;}.menu ul li:hover ul{ display:table;}.menu ul li ul{ position:absolute; width:350px; padding-left:30px; left:15px; background:#001126; display:none;}.menu ul li ul li{ float:left;}.menu ul li ul li a{ width:80px; line-height:24px; color:#fff; font-size:12px;}.menu ul li ul li a:hover{ background:none; color:#246477;}.main{ padding:20px; background:url(images/bottombg.jpg); height:183px;}.news{ float:left; width:220px; margin:0px 20px;}.news dl dd{ float:left; color:#464646; font-size:14px; font-weight:bold; line-height:24px;}.news dl dt{ float:right; line-height:24px; background:url(images/newsdd_bg.jpg) no-repeat left center; padding-left:6px;}.news ul li{ line-height:22px;}.news ul li a{ background:url(images/newa_bg.jpg) no-repeat left center; padding-left:10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; width:210px; display:block;} .about{ width:305px; display:table; margin:0px 20px; float:left;}.about img{ float:left; margin:20px;}.about img.view{ margin:5px 0px 0px 0px;}.about h3{ line-height:24px; margin-top:20px; color:#4380ab; font-size:16px;	}.about span{ line-height:20px; display:block;}.pro{ width:320px; float:left; border:1px solid #d7d7d7; display:table;}.pro ul{ float:left;}.pro ul.pro_ulview{ width:254px;}.pro ul.pro_ulview li{ float:left; background:none; width:157px; margin-right:10px;}.pro ul.pro_ulview li a.more{ margin:10px 0px 0px 20px; display:block;}.pro ul img.view{ margin-top:40px; }.pro ul img{ float:none; display:block;}.pro ul strong{ display:table; line-height:30px; margin-left:20px;}.pro ul span.view{ width:140px; display:block; margin-left:20px;}.pro ul li{ width:33px; height:112px; background:url(images/pro_libg.jpg);}.footer_logo{ float:left; margin:20px;}.footer_menu{ float:left; margin:5px 0px 0px 70px;}.footer_menu ul li{ float:left; width:102px; line-height:30px; text-align:center;}.footer_menu ul li.fli_line{ width:1px; background:url(images/fli_linebg.png) no-repeat; height:30px;}.footer_menu ul.bq{ margin-left:38px;}.footer_menu ul span{ line-height:22px; margin-right:10px; color:#7d7d7d;}.select{ float:right; margin-top:20px;}</style></head><body><div class="all">	<div class="top">		<ul>			<li><a href="#" class="a_hover">头部示例1</a></li>			<li><a href="#">头部示例2</a></li>			<li><a href="#">头部示例3</a></li>			<li><a href="#">头部示例4</a></li>		</ul>	</div>	<div class="clear"></div>	<div class="header">		<div class="logo">		<img src="images/logo.png" alt="logo" />		</div>		<div class="menu">			<ul>			<li class="li_line"></li>				<li>					<a href="#" class="menua_hover">菜单1</a>					<ul>						<li><a href="#">二级菜单1</a></li>						<li><a href="#">二级菜单2</a></li>						<li><a href="#">二级菜单3</a></li>						<li><a href="#">二级菜单4</a></li>					</ul>				</li>			<li class="li_line"></li>				<li><a href="#">菜单2</a>					<ul>						<li><a href="#">二级菜单1</a></li>						<li><a href="#">二级菜单2</a></li>						<li><a href="#">二级菜单3</a></li>						<li><a href="#">二级菜单4</a></li>					</ul>					</li>			<li class="li_line"></li>				<li><a href="#">菜单3</a></li>			<li class="li_line"></li>				<li><a href="#">菜单4</a></li>			<li class="li_line"></li>				<li><a href="#">菜单5</a></li>			<li class="li_line"></li>				<li><a href="#">菜单6</a></li>			<li class="li_line"></li>			</ul>		</div>	</div>	<div class="clear"></div>	<div>		<img src="images/banner.jpg" alt="banner" />	</div>	<div class="clear"></div>	<div class="main">		<div class="news">			<dl>				<dd>NEWS</dd>				<dt>more</dt>			</dl>			<div class="clear"></div>			<ul>			<li><a href="#">新闻示例1新闻示例1新闻示例1新闻示例1</a></li>			<li><a href="#">新闻示例2新闻示例2新闻示例2新闻示例</a></li>			<li><a href="#">新闻示例3新闻示例3新闻示例3新闻示例</a></li>			<li><a href="#">新闻示例4新闻示例4新闻示例4新闻示例</a></li>			</ul>		</div>		<div class="about">		<img src="images/about.png" alt="about" />		<h3>ABOUT</h3>		<span>关于我们关于我们关于我们关于我们关于我们关于我们</span>		<a href="#"><img src="images/about_view.png" alt="view" class="view"/></a>		</div>		<div class="pro">			<ul class="pro_ulview">			<li>			<strong>产品<span>案例1</span></strong>			<span class="view">产品简介产品简介产品简介产品简介产品简介产品简介产品简介产品简介</span>			<a href="#" class="more"><img src="images/about_view.png" alt="view"/></a>			</li>			<img src="images/pro_img.png" alt="pro" class="view"/>			</ul>			<ul>			<li></li>			</ul>			<ul>			<li></li>			</ul>		</div>		<div class="clear"></div>			<div class="footer_logo"><img src="images/footer_logo.png" alt="footer_logo" /></div>			<div class="footer_menu">			<ul>			<li><a href="#">首页</a></li>			<li class="fli_line"></li>			<li><a href="#">关于我们</a></li>			<li class="fli_line"></li>			<li><a href="#">产品中心</a></li>			</ul>			<div class="clear"></div>			<ul class="bq"><span>版权所有@某某网站</span><span>联系电话:01234567890</span></ul>			</div>			<div class="select"><img src="images/select.jpg" alt="select" /></div>	</div>	</div></body></html>
Copy after login

As for the pictures, just cut them out from the renderings if you need them.

This is my first time summarizing something like this, so please forgive me for any shortcomings. I hope I can communicate with everyone and make progress together.

Pages are generally divided into special effects pages and normal pages.

The layout is generally divided into menu LOGO, main content and copyright statement at the end.

The layout of the special effects page is uncertain. The layout of the ordinary page is generally divided into top, middle and bottom, and the middle part is divided into top and bottom structure or left and right structure. It will be easier to build the general frame first, and then fill it in bit by bit.

Finally, I will give you a reference website: http://www.w3school.com.cn/ which basically has everything you need for the front end. If you encounter problems, you can go there to find solutions. Highly recommended personally.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!