SlideShare ist ein Scribd-Unternehmen logo
1 von 22
ul&li
ul及li的定义 unordered list,无序列表。 list item,列表中的一条。
ul标签的写法 	<ul>  	<div> ul标签里也可以插入其他标签 </div> 	<li> 子标签 </li> 	<li> 子标签 </li> 	<li> 子标签 </li> </ul>
ul和li标签自身的CSS属性 List-style:包含三个子属性 List-style-type: 取值为none或url List-style-position: 取值为inside或outside List-style-image: 取值为none/disc/circle/square等
常见的用法 导航、次级导航、一组切换banner、商品列表、一群排列的链接。 关键词:一群排列的有共同功能、共同布局形式的组件。(外观上可以不同)
导航 整个导航是一个ul标签。 导航中的每一个单元是 li标签。 单元里的链接用a标签。 ul标签实现导航的背景。 li标签定位每个单元的位置。 a标签实现导航中每个单元链接的高度、宽度、文字大小、颜色、粗体、垂直居中等。 active 类实现当前导航所处位置的图片。
导航 <ul id=“nav”> 	<li> 		<a href=“#” class=“active”>我的支付宝</a> 	</li> 	<li>  		<a href=“#”>消费记录</a>  	</li> 	<li> 		<a href=“#”>安全中心</a> 	</li> </ul>
#nav { width:…; height:…; background:…; padding-left:…; } #navli { float:left; margin-top:…; padding-right:…; display:block; width:…; height:…; text-align:center; } #navli a { width:…; 	height:…; 	line-height:…; 	font-size:14px; 	color:#000; 	font-weight:bold; overflow:hidden; display:block; } #navlia.active { background:…; }
次级导航 次级导航依然是一个ul标签。包含在子单元的li标签内。 次级导航的结构与主导航一样:ulli      a。
<ul id=“nav”> <li> 	<a href=“#” class=“active”>消费记录</a> 	<ulid=“sub-nav”> 		<li>	 		<a href=“#” class=“active”>消费记录</a> 		</li> <li>	 				<a href=“#” class=“active”>充提记录</a> 			</li> 		</ul> </li> </ul>
次级导航 次级导航依附于主导航中的子单元存在,跟着子单元跑。 这时应该用什么定位方法?
次级导航 position定位方法。 主导航的子单元 li标签: position:relative; 次级导航的 ul标签: position:absolute;
次级导航 次级导航有背景。最方便的做法是将这个背景统一做到主导航中去。
#nav { width:…; height:…; background:…; padding-left:…; } #navli { float:left; margin-top:…; padding-right:…; display:block; width:…; height:…; text-align:center; position:relative; } #sub-nav { position:absolute; top:…; left:…; width:…; } #navli a { width:…; 	height:…; 	line-height:…; 	font-size:14px; 	color:#000; 	font-weight:bold; overflow:hidden; display:block; } #navlia.active { background:…; } #sub-navli { float:left; width:…; height:…; margin-right:…; text-align:center; display:block; }
#sub-navli a { width:…; height:…; line-height:…; font-size:…; color:…; overflow:hidden; display:block; } #sub-navlia.active { background:…; }
一组切换banner Banner 1 Banner 2 Banner 3 Banner 4 控制banner移动到显示框内,实现切换效果。
一组切换banner Banner 1 Banner 2 Banner 3 Banner 4 一组banner排列,用ul标签。 每个banner是一个 li标签。
一组切换banner 援助海地 轻松网购 生活支付 多种支付方式 控制切换banner的按钮也是一组排列的 li标签。
Banner 2 Banner 1 Banner 3 Banner 4 援助海地 轻松网购 轻松网购 轻松网购 <div id=“banner-frame”> <ul id=“banner-group”> 	<li><a href=“#”><img /></a></li> 	<li><a href=“#”><img /></a></li> <li><a href=“#”><img /></a></li> </ul> </div> <ul id=“banner-control”> <li><a href=“#”></a></li> <li><a href=“#”></a></li> <li><a href=“#”></a></li>s </ul> Banner 展现层 Banner 控制层
商品列表 整个列表是 ul标签。 每个商品是一个 li标签。
商品列表 实现方式上没有本质上的区别。需要注意的是: ul标签定义好宽度。 浮动的li标签在宽度满了之后会自动换行。 注意计算好li标签的宽度以及 li之间的距离。 注意浮动的 li标签外边距不合并。 注意浏览器兼容问题(双边距等)。
商品列表 Li Width: a; Li Width: a; Li Width: a; Margin-left: b; ul { width: 3a+3b; }

Weitere ähnliche Inhalte

Empfohlen

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 

Empfohlen (20)

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 

Ul&Li