Diversified website layouts are our front-end specialty! Recently I saw that the default tab page of UC Browser uses a nine-square grid layout. I did some research, and here, I will share the code and learn together! The effect is as follows:
XML/HTML CodeCopy content to clipboard
- >
-
<html>
-
<head>
-
<meta charset="utf- 8">
-
<title>Fully compatible HTML nine-square grid layout title>
-
<meta http-equiv=" " >
head>
-
<body>
-
<html>
-
<head>
-
<style type
=- "text/ css">
/**Reset browser default tab style*/
body,ul,li{margin:0;padding:0;}
.xttblog{
- width: 1200px;
- height: 170px;
- margin-top:50px;
- margin-left: auto;
- margin-right: auto;
- }
- .box{margin-left: 5px;margin-top: 5px;list-style-type:none;}
- .box:after{
- content: ".";
- display: block;
- line-height: 0;
- width:0;
- height: 0;
- clear: both;
- visibility: hidden;
- overflow: hidden;
- }
- .box li{float:left;line-height: 230px;}
- .box li a,.box li a:visited{
- display:block;
- border: 5px solid #ccc;
- width: 380px;
- height: 230px;
- text-align: center;
- margin-left: -5px;
- margin-top: -5px;
- position: relative;
- z-index: 1;
- }
- .box li a:hover{border-color: #f00;z-index: 2;}
-
style>
-
head>
-
<body>
-
<div class="xttblog">
-
<ul class="box">
-
<li><a href="#" title="1"><img src="sh.jpg"/>a>li>
-
<li><a href="#" title="2"><img src="bd.jpg"/>a>li>
-
<li><a href="#" title="3"><img src="tb.jpg"/>a>li>
-
<li><a href="#" title="4"><img src="fh.jpg"/>a>li>
-
<li><a href="#" title="5"><img src="tb.jpg"/>a>li>
-
<li><a href="#" title="6"><img src="tb.jpg"/>a>li>
-
<li><a href="#" title="7"><img src="tb.jpg"/>a>li>
-
<li><a href="#" title="8"><img src="tb.jpg"/>a>li>
-
<li><a href="#" title="9"><img src="tb.jpg"/>a>li>
-
ul>
-
div>
-
body>
-
html>
-
The above is the entire content of this article, I hope it will be helpful to everyone’s study.