Home > Web Front-end > HTML Tutorial > Implementation method of HTML nine-square grid layout_HTML/Xhtml_Web page production

Implementation method of HTML nine-square grid layout_HTML/Xhtml_Web page production

WBOY
Release: 2016-05-16 16:36:01
Original
3117 people have browsed it

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
  1. >
  2. <html>
  3. <head>
  4. <meta charset="utf- 8"> 
  5. <title>Fully compatible HTML nine-square grid layouttitle>
  6. <meta http-equiv=" " > head>
  7. <body>
  8. <html>
  9. <head>
  10. <style type
  11. =
  12. "text/ css"> /**Reset browser default tab style*/ body,ul,li{margin:0;padding:0;} .xttblog{
  13. width: 1200px;
  14. height: 170px;
  15. margin-top:50px;
  16. margin-left: auto;
  17. margin-right: auto;
  18. }
  19. .box{margin-left: 5px;margin-top: 5px;list-style-type:none;}
  20. .box:after{
  21. content: ".";
  22. display: block;
  23. line-height: 0;
  24. width:0;
  25. height: 0;
  26. clear: both;
  27. visibility: hidden;
  28. overflow: hidden;
  29. }
  30. .box li{float:left;line-height: 230px;}
  31. .box li a,.box li a:visited{
  32. display:block;
  33. border: 5px solid #ccc;
  34. width: 380px;
  35. height: 230px;
  36. text-align: center;
  37. margin-left: -5px;
  38. margin-top: -5px;
  39. position: relative;
  40. z-index: 1;
  41. }
  42. .box li a:hover{border-color: #f00;z-index: 2;}  
  43. style>  
  44. head>  
  45. <body>  
  46. <div class="xttblog">  
  47.  <ul class="box">  
  48.   <li><a href="#" title="1"><img src="sh.jpg"/>a>li>  
  49.   <li><a href="#" title="2"><img src="bd.jpg"/>a>li>  
  50.   <li><a href="#" title="3"><img src="tb.jpg"/>a>li>  
  51.   <li><a href="#" title="4"><img src="fh.jpg"/>a>li>  
  52.   <li><a href="#" title="5"><img src="tb.jpg"/>a>li>  
  53.   <li><a href="#" title="6"><img src="tb.jpg"/>a>li>  
  54.   <li><a href="#" title="7"><img src="tb.jpg"/>a>li>  
  55.   <li><a href="#" title="8"><img src="tb.jpg"/>a>li>  
  56.   <li><a href="#" title="9"><img src="tb.jpg"/>a>li>  
  57.  ul>  
  58. div>  
  59. body>
  60. html>

The above is the entire content of this article, I hope it will be helpful to everyone’s study.

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