Simple html css page production_html/css_WEB-ITnose
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>
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.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

HTML, CSS and JavaScript are the core technologies for building modern web pages: 1. HTML defines the web page structure, 2. CSS is responsible for the appearance of the web page, 3. JavaScript provides web page dynamics and interactivity, and they work together to create a website with a good user experience.

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.
