大家好,本篇文章分享企業網站圖文列表的佈局樣式,歡迎參考和指正。
話不多少,看效果圖:

企業網站圖文列表佈局樣式
HTML代碼:
CSS代碼分析:
使用flex水平垂直居中
.tui-004 { display: flex; align-items: center; justify-content: center; height: 100vh; }
使用flex佈局,固定高度
.tui-004 .tui-w { display: flex; flex-wrap: wrap; justify-content: space-between; width: 1200px; }
文章首條圖文列表佈局,relative父元素相對定位,內左邊距,最低高度
.tui-004 .tui-c { position: relative; padding: 0 0 0 200px; min-height: 117px; }
圖文列表佈局配置標題字體大小,顏色,粗細,內上邊距
.tui-004 .tui-c h3 { font-size: 18px; color: #333; font-weight: 400; padding: 5px 0 0 0; }
圖文列表佈局配置簡介字體大小,顏色,行高
.tui-004 .tui-c p { font-size: 13px; color: #666; line-height: 24px; }
圖文列表佈局配置圖片absolute子元素絕對定位,上左歸零,高度和寬度
.tui-004 .tui-c img { position: absolute; left: 0; top: 0; width: 180px; height: 117px; }
標題列表佈局,relative父元素相對定位,固定高度和行高,內下邊距,外下邊距和下邊框
.tui-004 .tui-b li { position: relative; height: 33px; line-height: 33px; margin-bottom: 13px; padding-bottom: 13px; border-bottom: 1px dashed #eee; }
標題列表佈局配置字體大小和顏色
.tui-004 .tui-b li a { font-size: 14px; color: #333; }
注:以上部分CSS代碼只是幫助大家分析結構,是需要清除所有標籤的默認樣式。
有問題可以留言,大家一起學習HTML+CSS網頁設計。