我在其中一个使用Twitter Bootstrap设计的页面中有一个无序列表。
String HTML = @" <h1>School Closings</h1> <div id=""schoolForecast""> <h3 style=""font-family:'Arimo',Arial,sans-serif; color:#000; font-size:14px;"">Forecast: School's Open.</h3>
<p class=""schoolOpen"">But don't worry, we update this page regularly so you'll be the first to know if your school is closing or will have delays due to bad weather. In the meantime, check your <a href='/weather/'>local weather</a> to see if things will change.</p>
<p class=""schoolOpen""></p> </div> </div> </div>";
HtmlAgilityPack.HtmlDocument Doc = new HtmlAgilityPack.HtmlDocument();
Doc.LoadHtml(HTML);
HtmlNode Node = Doc.GetElementbyId("schoolForecast");
MessageBox.Show(Node.InnerText);
如何在这些li标签之间添加行间距?
答案 0 :(得分:4)
只需为所有li元素添加边距,但不能添加最后一个元素。
ul > li + li {
margin-bottom: 5px;
}