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="/static/imghwm/default1.png" data-src="images/logo.png" class="lazy" 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="/static/imghwm/default1.png" data-src="images/banner.jpg" class="lazy" 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="/static/imghwm/default1.png" data-src="images/about.png" class="lazy" alt="about" /> <h3 id="ABOUT">ABOUT</h3> <span>关于我们关于我们关于我们关于我们关于我们关于我们</span> <a href="#"><img class="view lazy" src="/static/imghwm/default1.png" data-src="images/about_view.png" alt="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="/static/imghwm/default1.png" data-src="images/about_view.png" class="lazy" alt="view"/></a> </li> <img class="view lazy" src="/static/imghwm/default1.png" data-src="images/pro_img.png" alt="pro"/> </ul> <ul> <li></li> </ul> <ul> <li></li> </ul> </div> <div class="clear"></div> <div class="footer_logo"><img src="/static/imghwm/default1.png" data-src="images/footer_logo.png" class="lazy" 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="/static/imghwm/default1.png" data-src="images/select.jpg" class="lazy" 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.

HTMLtagsdefinethestructureofawebpage,whileattributesaddfunctionalityanddetails.1)Tagslike,,andoutlinethecontent'splacement.2)Attributessuchassrc,class,andstyleenhancetagsbyspecifyingimagesources,styling,andmore,improvingfunctionalityandappearance.

The future of HTML will develop in a more semantic, functional and modular direction. 1) Semanticization will make the tag describe the content more clearly, improving SEO and barrier-free access. 2) Functionalization will introduce new elements and attributes to meet user needs. 3) Modularity will support component development and improve code reusability.

HTMLattributesarecrucialinwebdevelopmentforcontrollingbehavior,appearance,andfunctionality.Theyenhanceinteractivity,accessibility,andSEO.Forexample,thesrcattributeintagsimpactsSEO,whileonclickintagsaddsinteractivity.Touseattributeseffectively:1)Usese

The alt attribute is an important part of the tag in HTML and is used to provide alternative text for images. 1. When the image cannot be loaded, the text in the alt attribute will be displayed to improve the user experience. 2. Screen readers use the alt attribute to help visually impaired users understand the content of the picture. 3. Search engines index text in the alt attribute to improve the SEO ranking of web pages.

The roles of HTML, CSS and JavaScript in web development are: 1. HTML is used to build web page structure; 2. CSS is used to beautify the appearance of web pages; 3. JavaScript is used to achieve dynamic interaction. Through tags, styles and scripts, these three together build the core functions of modern web pages.

Setting the lang attributes of a tag is a key step in optimizing web accessibility and SEO. 1) Set the lang attribute in the tag, such as. 2) In multilingual content, set lang attributes for different language parts, such as. 3) Use language codes that comply with ISO639-1 standards, such as "en", "fr", "zh", etc. Correctly setting the lang attribute can improve the accessibility of web pages and search engine rankings.

HTMLattributesareessentialforenhancingwebelements'functionalityandappearance.Theyaddinformationtodefinebehavior,appearance,andinteraction,makingwebsitesinteractive,responsive,andvisuallyappealing.Attributeslikesrc,href,class,type,anddisabledtransform

TocreatealistinHTML,useforunorderedlistsandfororderedlists:1)Forunorderedlists,wrapitemsinanduseforeachitem,renderingasabulletedlist.2)Fororderedlists,useandfornumberedlists,customizablewiththetypeattributefordifferentnumberingstyles.


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

Atom editor mac version download
The most popular open source editor

WebStorm Mac version
Useful JavaScript development tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

Dreamweaver Mac version
Visual web development tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
