


Although IE6 can no longer be considered except for some demanding requirements, the browser IE8 that comes with WIN7 still needs to be supported.
The main advantage of this method in this article, personally, is that it requires less preparation. You don’t need to go online to find a lot of pictures as materials. You only need to prepare bootstrap, jquery and photoshop. How to configure bootstrap and jquery? Refer to "[Bootstrap] A dialog box that pops up on the current web page, which can be closed without jumping, and is not a pop-up window" (click to open the link)
When asked to write a website, I am often troubled by how to layout it,
In fact, it is not difficult. If you can use Bootstrap proficiently and have a specific set of methods,
then you can still quickly and easily hand in homework for ordinary needs.
Although there are a lot of page templates to search on the Internet, the key is to be able to understand the creation process of these page templates.
Once these downloaded templates are incompatible with the browser and cannot be modified, you will be in big trouble.
1. Basic goal
Use BootstrapV3 to create the following page:
The homepage is as shown above. The first thing hanging at the top of the page is the navigation of this website, which is the three buttons left, middle, and right and the dropdown menu. The essence here is a button group, and the navigation bar component provided by Bootstrap cannot be used because this navigation bar component is not compatible with IE8. For details, see: "[Bootstrap] Navigation bar navbar defects and solutions on IE8" article (click to open the link )
After that, under the giant screen, there are three columns and two corresponding buttons,
Here you can place the most important parts of the website,
The last one is copyright information as usual.
The inner page looks like this:
It is also the top navigation bar,
Then the title of this inner page and content. The title of the inner page is actually a giant screen, but it is smaller than the size of the home page.
The next step is the copyright information.
2. Production process
1. First open photoshop and create a new 1024x1 image with any width, as wide as possible. The image is 1 That’s it. The foreground color is dark green R:0 G:140 B:0, and the background color is light green R:100 G:200 B:100. Use the gradient tool to pull out the following image. You can pull it to the left or right no matter how you pull it. You can pull it from the middle to the sides, it depends on your personal preference:
This is the only image we need to prepare. You can close photoshop, put it aside, and put this The image is saved in the website project folder.
This image is only about 6k, which does not affect loading at all.
2. Home page
The specific code is as follows, and then the code is explained one by one:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>无标题文档</title> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link href="css/bootstrap.css" rel="stylesheet" media="screen"> <script type="text/javascript" src="js/jquery-1.11.1.js"></script> <script type="text/javascript" src="js/bootstrap.js"></script> <style type="text/css"> h1,h2,h3,h4,h5 { font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", "Hiragino Sans GB W3", "WenQuanYi Micro Hei", sans-serif; } </style> <div style="position: absoulted; top: 0; left: 0; width: 100%;"> <div class="btn-group btn-group-justified"> <div class="btn-group"> <button type="button" class="btn btn-success"> Left </button> </div> <div class="btn-group"> <button type="button" class="btn btn-success"> Middle </button> </div> <div class="btn-group"> <button type="button" class="btn btn-success"> Right </button> </div> <div class="btn-group"> <button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown"> Dropdown <span class="caret"></span> </button> <ul class="dropdown-menu" role="menu"> <li> <a href="#">Dropdown link</a> </li> <li> <a href="#">Dropdown link</a> </li> </ul> </div> </div> </div> <div class="jumbotron masthead" style="background-image: url(images/bg.jpg); background-repeat: repeat; text-align: center"> <br> <br> <br> <br> <br> <h1 id="font-color-ffffff-Banner-the-Main-headline-font"> <font color="#ffffff">Banner : the Main headline</font> </h1> <h2 id="font-color-ffffff-Sub-heading-font"> <font color="#ffffff">Sub-heading</font> </h2> <br> <br> <br> <br> <br> </div> <div class="container"> <div class="row"> <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 "> <div class="panel panel-default"> <div class="panel-body"> <h3 id="Column"> Column1 </h3> <p> ... </p> <p> <a href="#" class="btn btn-success" role="button">Button</a> <a href="#" class="btn btn-default" role="button">Button</a> </p> </div> </div> </div> <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4"> <div class="panel panel-default"> <div class="panel-body"> <h3 id="Column"> Column2 </h3> <p> ... </p> <p> <a href="#" class="btn btn-success" role="button">Button</a> <a href="#" class="btn btn-default" role="button">Button</a> </p> </div> </div> </div> <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4"> <div class="panel panel-default"> <div class="panel-body"> <h3 id="Column"> Column2 </h3> <p> ... </p> <p> <a href="#" class="btn btn-success" role="button">Button</a> <a href="#" class="btn btn-default" role="button">Button</a> </p> </div> </div> </div> </div> <div class="panel panel-default"> <div class="panel-body" style="text-align: center"> Copyright information </div> </div> </div>
(1)
section<!--网站编码,标题,自适应屏幕等--> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>无标题文档</title> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <!--需要使用的js与css样式--> <link href="css/bootstrap.css" rel="stylesheet" media="screen"> <script type="text/javascript" src="js/jquery-1.11.1.js"></script> <script type="text/javascript" src="js/bootstrap.js"></script> <!--这是唯一需要我们自己定义的css样式,用来解决win7系统下,微软雅黑字体无法正常显示,而显示宋体的bug--> <style type="text/css"> h1,h2,h3,h4,h5 { font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", "Hiragino Sans GB W3", "WenQuanYi Micro Hei", sans-serif; } </style>(2) Navigation bar
Due to the navigation bar provided by bootstrap not applicable , we have to use the button group provided by bootstrap to write the navigation bar ourselves
<!--首先导航栏必必须挂在网页头--> <div style="position: absoulted; top: 0; left: 0; width: 100%;"> <!--定义一个按钮组--> <div class="btn-group btn-group-justified"> <div class="btn-group"> <!--导航栏中单个按钮,也就是没有下拉菜单的按钮的超级链接写作方式需要注意,是使用a标签,然后加上class样式的,而不是官网提供的button标签--> <a href="#" class="btn btn-success"> Left </a> </div> <div class="btn-group"> <a href="#" class="btn btn-success"> Middle </a> </div> <div class="btn-group"> <a href="#" class="btn btn-success"> Right </a> </div> <!--下拉菜单的写法如下:--> <div class="btn-group"> <button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown"> Dropdown <span class="caret"></span> </button> <ul class="dropdown-menu" role="menu"> <li> <a href="#">Dropdown link</a> </li> <li> <a href="#">Dropdown link</a> </li> </ul> </div> </div> </div>Change btn-success in the class attribute to btn-primary, btn-danger, etc. can change the color of this button. !
(3) Giant screen part
The giant screen is written as follows. The key is to introduce the background we just drew with photoshop
The reason why here The reason for adding so many
carriage returns is to enlarge the size of this giant screen
<div class="jumbotron masthead" style="background-image: url(images/bg.jpg); background-repeat: repeat; text-align: center"> <br> <br> <br> <br> <br> <h1 id="font-color-ffffff-Banner-the-Main-headline-font"> <font color="#ffffff">Banner : the Main headline</font> </h1> <h2 id="font-color-ffffff-Sub-heading-font"> <font color="#ffffff">Sub-heading</font> </h2> <br> <br> <br> <br> <br> </div>(4) Column part
Bootstrap is used here Grid organization, layout of three columns
For details, please refer to my article "[Bootstrap] Automatically adapt to the Bootstrap grid system for PCs, tablets, and mobile phones" (click to open the link),
Divide the 12 cells of the entire web page into 3 parts, each of 4 cells is just fine
And each column is a panel without a panel header, with an h3 title inside, and then a paragraph of p Text, and two buttons
It is worth noting that these things must be placed within a container, otherwise these three things will occupy the entire page:
<div class="container"> <div class="row"> <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 "> <div class="panel panel-default"> <div class="panel-body"> <h3 id="Column"> Column1 </h3> <p> ... </p> <p> <a href="#" class="btn btn-success" role="button">Button</a> <a href="#" class="btn btn-default" role="button">Button</a> </p> </div> </div> </div> <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4"> <div class="panel panel-default"> <div class="panel-body"> <h3 id="Column"> Column2 </h3> <p> ... </p> <p> <a href="#" class="btn btn-success" role="button">Button</a> <a href="#" class="btn btn-default" role="button">Button</a> </p> </div> </div> </div> <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4"> <div class="panel panel-default"> <div class="panel-body"> <h3 id="Column"> Column2 </h3> <p> ... </p> <p> <a href="#" class="btn btn-success" role="button">Button</a> <a href="#" class="btn btn-default" role="button">Button</a> </p> </div> </div> </div> </div> ( 5) Copyright information section <p></p> <p>There is nothing to say, it is just a panel </p> <p></p> <pre name="code" class="sycode"><div class="panel panel-default"> <div class="panel-body" style="text-align: center"> Copyright information </div> </div>
3. If the inner page
can be used as the homepage, then the idea of the inner page will be exactly the same, so I won’t repeat it. Similarly, the code is as follows:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>无标题文档</title> <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> <link href="css/bootstrap.css" rel="stylesheet" media="screen"> <script type="text/javascript" src="js/jquery-1.11.1.js"></script> <script type="text/javascript" src="js/bootstrap.js"></script> <style type="text/css"> h1,h2,h3,h4,h5 { font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", "Hiragino Sans GB W3", "WenQuanYi Micro Hei", sans-serif; } </style> <div style="position: absoulted; top: 0; left: 0; width: 100%;"> <div class="btn-group btn-group-justified"> <div class="btn-group"> <a href="#" class="btn btn-success"> Left </a> </div> <div class="btn-group"> <a href="#" class="btn btn-success"> Middle </a> </div> <div class="btn-group"> <a href="#" class="btn btn-success"> Right </a> </div> <div class="btn-group"> <button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown"> Dropdown <span class="caret"></span> </button> <ul class="dropdown-menu" role="menu"> <li> <a href="#">Dropdown link</a> </li> <li> <a href="#">Dropdown link</a> </li> </ul> </div> </div> </div> <div class="jumbotron masthead" style="background-image: url(images/bg.jpg); background-repeat: repeat;"> <h1 id="font-color-ffffff-Title-font"> <font color="#ffffff">Title</font> </h1> </div> <div class="container-fluid"> <div class="panel panel-default"> <div class="panel-body"> Content </div> </div> <div class="panel panel-default"> <div class="panel-body" style="text-align: center"> Copyright information </div> </div> </div>

The official account web page update cache, this thing is simple and simple, and it is complicated enough to drink a pot of it. You worked hard to update the official account article, but the user still opened the old version. Who can bear the taste? In this article, let’s take a look at the twists and turns behind this and how to solve this problem gracefully. After reading it, you can easily deal with various caching problems, allowing your users to always experience the freshest content. Let’s talk about the basics first. To put it bluntly, in order to improve access speed, the browser or server stores some static resources (such as pictures, CSS, JS) or page content. Next time you access it, you can directly retrieve it from the cache without having to download it again, and it is naturally fast. But this thing is also a double-edged sword. The new version is online,

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

This article demonstrates efficient PNG border addition to webpages using CSS. It argues that CSS offers superior performance compared to JavaScript or libraries, detailing how to adjust border width, style, and color for subtle or prominent effect

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

This article explains the HTML5 <time> element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati


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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
