【发布时间】:2018-03-10 21:33:30
【问题描述】:
<footer id="colophon" class="site-footer">
<div class="site-footer__form-container widget-area">
<div id="footer-sidebar1">
<?php if(is_active_sidebar('footer-sidebar-1')){
dynamic_sidebar('footer-sidebar-1');
}
?>
</div>
</div>
<div class="site-footer__nav-container">
<div class="site-footer__events">
<h3 class="site-footer__title">Events</h3>
<ul class="site-footer__nav-list">
<li class="site-footer__list-item">
<a href="./special-events" class="site-footer__link">Parade Of Lights</a>
</li>
<li class="site-footer__list-item">
<a href="./special-events" class="site-footer__link">SeaFair</a>
</li>
<li class="site-footer__list-item">
<a href="./special-events" class="site-footer__link">Burials At Sea</a>
</li>
</ul>
</div>
<div class="site-footer__about">
<h3 class="site-footer__title">About us</h3>
<ul class="site-footer__nav-list">
<li class="site-footer__list-item">
<a href="./owners" class="site-footer__link">Owners</a>
</li>
<li class="site-footer__list-item">
<a href="./blog" class="site-footer__link">Blog</a>
</li>
</ul>
</div>
<div class="site-footer__contact">
<h3 class="site-footer__title">Weddings</h3>
<ul class="site-footer__nav-list">
<li class="site-footer__list-item">
<a href="./wedding-info" class="site-footer__link">Wedding Info</a>
</li>
<li class="site-footer__list-item">
<a href="./wedding-menus" class="site-footer__link">Wedding Menus</a>
</li>
</ul>
</div>
</div>
<div class="site-footer__contact-container">
<p class="site-footer__phone">(206) 123-4567</p>
<p class="site-footer__address">
<a href="#" class="site-footer__link">1234 Water St. Seattle, WA 98107</a>
</p>
<div class="site-footer__icons-container">
<div class="site-footer__facebook"></div>
<div class="site-footer__instagram"></div>
<div class="site-footer__twitter"></div>
</div>
</div>
<div class="site-footer__copyright-container">
<p class="site-footer__copywrite">Copyright © 2017 Friendship Charters. All Rights Reserved.</p>
</div>
</footer>
我正在尝试为网站的页脚编写 HTML,我想知道我是否正确遵循 BEM 方法/样式指南。这让我很困惑。我永远不确定我是否应该创建更多的“块”。这是正确的吗?感谢您的任何见解。
【问题讨论】:
-
完全没问题,可能不完美(我在 BEM 方面没那么酷),但看起来没问题
-
如果您在使用工具或方法时遇到问题,这并不总是您的错——可能是工具或方法的问题。许多人对 BEM 感到困惑。即使正确实施,它也非常冗长。再加上最近的趋势(包括 CSS 范围界定)已经减少了对 BEM 之类的需求的事实,这就是为什么你最近很少听到它的原因——很少有人在使用它。你应该仔细考虑你是否真的想致力于 BEM。
-
@torazaburo "CSS 范围" 喜欢the obsolete
:scopepseudo-class? -
我投票决定将此问题作为离题结束,因为它要求进行代码审查(因此这太宽泛/基于意见)。它可能会被调整为the code review stackexchange 的主题。
-
@Paleo 哈哈。不,我的意思是像 CSS 模块一样的 CSS 范围,或在 Angular 等框架中找到的 CSS 范围。