<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">
Parade Of Lights
</li>
<li class="site-footer__list-item">
SeaFair
</li>
<li class="site-footer__list-item">
Burials At Sea
</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">
Owners
</li>
<li class="site-footer__list-item">
Blog
</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">
Wedding Info
</li>
<li class="site-footer__list-item">
Wedding Menus
</li>
</ul>
</div>
</div>
<div class="site-footer__contact-container">
<p class="site-footer__phone">(206) 123-4567</p>
<p class="site-footer__address">
1234 Water St. Seattle, WA 98107
</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>
Here I am trying to write the HTML for a footer of a website, and I am wondering if I am correctly following the BEM methodology/style guide. It's pretty confusing to me. I'm never sure if I should create more 'blocks' or not. Would this be correct? Thanks for any insight.
Your code is OK for the BEM syntax. But monolithic, too semantic, and nothing is reusable. I suggest to use the following hierarchy of blocks:
site-footer
widget-area
multi-columns
titled-list (events)
titled-list (about)
titled-list (contact)
contact-box
icon (facebook)
icon (instagram)
icon (twitter)
The HTML code:
<footer id="colophon" class="site-footer">
<div class="site-footer__form-container widget-area">
...
</div>
<div class="site-footer__nav-container multi-columns">
<div class="multi-columns__col titled-list">
<h3 class="titled-list__title">Events</h3>
<ul class="titled-list__ul">
<li class="titled-list-li">
Parade Of Lights
</li>
<li class="titled-list-li">
SeaFair
</li>
<li class="titled-list-li">
Burials At Sea
</li>
</ul>
</div>
<div class="multi-columns__col titled-list">
...
</div>
<div class="multi-columns__col titled-list">
...
</div>
</div>
<div class="site-footer__contact-container contact-box">
<p class="contact-box__phone">(206) 123-4567</p>
<p class="contact-box__address">
1234 Water St. Seattle, WA 98107
</p>
<div class="contact-box__icons-container">
<div class="icon icon--facebook"></div>
<div class="icon icon--instagram"></div>
<div class="icon icon--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>
Each block is a context. Each element is related to its block context. That means a block is not aware where it is positioned. Only elements can be positioned, related to the parent block. In your example, the elements .site-footer__form-container, .site-footer__nav-container, etc. are responsible for positioning the child blocks .widget-area, .multi-columns, etc. inside the parent block .site-footer.
If a pattern is repeated, remember to reuse the same blocks (.icon) or elements (.multi-columns__col) and add modifiers for possible differences.
Always think how to make your CSS classes reusable in the rest of the Web page (maybe you could use .multi-columns or .icon elsewhere?).
If something could be a block but is small and not reusable elsewhere (the copyright container), then you can keep it as an element in the parent block just because it is simpler.
Related
I've recently designed a website and have realised that some of the background of the content, when you scroll down is transparent and so the fixed div that is beneath the content displays on IE and Firefox. Please see my website for a live view of the problem. The HTML is below. Please see below an image of my problem as you can see the text "Get In Touch" is being displayed. I want the background of the content to be above this. Please find attached the fiddle.
<body>
<div class="overlay overlay-hugeinc">
<button type=button class=overlay-close></button>
<img src=http://kadeem.london/Image/Transparent-Kadeem-min.png class="fixed-Me scaling">
<nav>
<ul>
<li><a href=http://kadeem.london>Home</a></li>
<li><a href=papers.html>Papers</a></li>
<li><a href=events.html>Events</a></li>
<li><a href=designs.html>Designs</a></li>
</ul>
</nav>
</div>
<div id=trigger-overlay>
<div class=menubutton>
<h3 class=menubuttontext>MENU</h3></div></div>
<div class=high-container>
<div class=global-container>
<div class=Intro-Video>
<div class=video-box>
<div id=video-container>
<video autoplay class=fillWidth>
<source src=Video/Trailer.mp4 type="video/mp4"/>
</video>
<div class=Kadeem-Logo>
<img src=http://kadeem.london/Image/KL-LOGO.png>
</div>
</div>
</div>
</div>
<div class=content-container>
<div class=row>
<div class="border red"></div>
<h1 class=title-role>
I'm Kadeem
</h1>
</div>
<div class=post-container>
<div class=Biographical-Content>
<div class="step out-view"></div>
<br>
<p>I go by the name of <a href=https://www.linkedin.com/pub/kadeem-laurie/57/277/9b5>Kadeem Laurie</a>. I am an events graduate currently developing an events marketing start-up. This website was created from scratch using HTML5, CSS3,jQuery & responsive design. I specialise in event management, digital content, SEO, marketing strategy, branding and front-end web design. <p> Freedom of thought inspires me. I love conceptualising and seeing ideas evolve. I see myself as a marketeer who simply likes to make things look good, branding has thus always been my most favourable aspect of marketing. I studied event management in university and have organised a <a href=events.html> few events</a> of my own. I am currently working as an event organiser at <a href=https://en.wikipedia.org/wiki/Spire_Healthcare>Spire Healthcare</a>. I hope to integrate events within marketing strategy more. I like to ask the <a href=http://stackoverflow.com/users/1923610/kadeem-laurie target=_blank>right questions</a> and find solutions from different perspectives. My academic interests lie in the regions of city branding and <a href=https://www.academia.edu/14690454/The_Commercial_and_Political_Implications_of_Events>events management.</a> <p>My favourite book is <a href=https://en.wikipedia.org/wiki/The_Prince>The Prince</a> by Nicolo Machievelli. My favourite dish is <a href=http://lifestyle.sapo.pt/sabores/receitas/arroz-de-marisco>Arroz De Marisco.</a> This website has been recently created so content is being added concurrently.
<p>
</p>
</div>
</div>
</div>
<div class=other-contain>
<div class=My-Gems>
<div id=effect-6 class="effects clearfix">
<div class=img>
<img src=https://alchetron.com/cdn/zeebra-5e766eb1-964a-49c5-b888-c05effa9354-resize-750.jpeg style=height:100% alt>
<div class=overlay5>
<a class=expand>Bone & Joint Launch</a>
</div>
</div>
<div class=img>
<img src=http://kadeem.london/Image/Money-Matters-Logo.png alt>
<div class=overlay5>
<a href=designs.html class=expand>Money Matters</a>
</div>
</div></div>
</div>
</div>
<div class=eee>
<div class=row>
<section id=activities class=pane>
<div class=pane-content>
<div class=pane-row>
<div class=summary>
<p>POSTS</p>
</div>
</div>
<div class="pane-row d">
<div class=activity-col>
<h4>city branding</h4>
<ul>
<li><a>The Impact of City Branding in The Perceived Image of Cities: The Case of New York City</a></li>
</ul>
<h4>Urban Regeneration</h4>
<ul>
<li>The Role of Events in Urban Regeneration</li>
<li>Hacknified</li>
</ul>
</div>
<div class=activity-col>
<h4>Marketing Strategy</h4>
<ul>
<li>Marketing Strategy: British Airways vs. Air France</li>
<li>The Marketing Strategies of Startup Brands</li>
</ul>
<h4>Events Management</h4>
<ul>
<li>The Political & Commerical Implications of Events</li>
</ul>
</div>
<div class=activity-col>
<h4>Events Marketing</h4>
<ul>
<li>Marketing Events Online</li>
<li>The Role of City Branding in Urban Tourism</li>
</ul>
<h4>Digital Marketing</h4>
<ul>
<li>Digital Content</li>
<li>Post Purchase Behaviour of Hotel Guests</li>
</ul>
</div>
</div>
</div>
</section>
<footer class=goodbye>
<div class="border red4"></div>
<div class=block>
<div class=centered>
<h2 class=text-go>GET IN TOUCH</h2>
</div>
</div>
</footer>
<footer class=goodbye4>
<div class=block6>
<div class=centered6>
If you would like to find out more about me you can <a href=mailto:kadeemlaurie#gmail.com>message me</a>.
</div>
</div>
</footer>
<footer class=goodbye5>
<div class=container1>
<footer class=footer>
<div class=container1>
<div class=flex-item>© 2015 KADEEM</div>
</div>
</footer>
</div>
</div>
You have an empty P tag inside your post-container that is causing this gap. Remove it and it will fix everything accross all browsers. Also, once the empty tag is removed, you could give the last P element (with the "My favourite book" text) a padding-bottom of 45px to push the container down correctly.
<div class="post-container">
<div class="Biographical-Content hidden visible animated fadeInUpBig">
<div style="height: 407px;" class="step out-view active"></div>
<br>
<p>I go by the name of [...]</p>
<p> Freedom of thought [...]</p>
<p>My favourite book [...]</p>
<p></p> --> Empty P tag
</div>
</div>
If for any reason you can't avoid having that "extra" <p> in your html; add this to your css
p:last-child {
display: none;
}
Here is my code:
<div class="wrap">
<div id ="header">
<a href="index" class = "logo">
<img src = "logo.png" alt = "" />
</a>
<nav class="navigation">
<ul>
<li>Share</li> |
<li>Join</li> |
<li>See Safty Tips</li> |
<li>Settings</li>
</ul>
</nav>
</div>
<div class="wrapper">
<img src="accident.png" alt="">
<div id="right-content">
<h2>Hit and Run No Injuries</h2>
<p>2.610 miles from your new neighbor<br />
May 20, 2015 at 12.34 PM </p>
<h4>California HWP 2 - High Level</h4>
</div>
</div>
<div class="wrap">
<ul class="secure_v5">
<li id="li-incident">
<a class="inviteLink dark" href="/v5/Resources.aspx?IFrameURL=Invitationv5&vn=&gORn=1">See Incident Location</a>
</li>
<li id="login-signup">
<a class="button dark" href="V4/Login.aspx?v5=1">Share Incident with Friends</a>
</li>
</ul>
</div>
<div class="thanks">
<p>Sincerely,<br />
The AlertID Team</p>
</div>
<p style="text-align:center;">This sponsor is helping to protect your neighborhood</p>
<div class="footer-links">
<ul>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</div>
and here is jsfiddle , (didn't include images)
When i run this code, some alignment is not correct,
I need something same like this
I just confused with which exact css can be used, Can anyone help me please?
Thanks,
Use HTML tables to control the design layout and some presentation. You may be used to using pure CSS layouts for your web pages, but that approach just won’t hold up in an email environment.
Use inline CSS to control other presentation elements within your email, such as background colors and fonts.
You just put div #right-content to right
try it on CSS.
#right-content {
float:right;
width:600px;
}
#right-content h2{
text-align:center;
}
I create a little attribute to h2 inside div #right-content
and define a fixed width for right-content. It's necessary because of attribute float: right.
In the below code unordered list bullet symbols are not displaying. Can any one help me.
expected output:
Smart class (Digital Technology) as a part of classroom teaching.
html
<section class="container">
<div class="row">
<!-- main content -->
<section class="col-sm-8 maincontent">
<h3>Our Facilities</h3>
<img src="assets/images/about.jpg" alt="" class="img-rounded pull-right" width="300" />
<ul>
<li>Smart class (Digital Technology) as a part of classroom teaching.</li>
<li>Karate Classes</li>
<li>Well equipped, Compute Lab and Science Lab.</li>
<li>CET classes,</li>
<li>Sports Academy.</li>
<li>Eco and Environment Club,Adventure Club.</li>
</ul>
</div>
</div>
</section>
</div>
</section>
Check your CSS. Make sure it contains something similar to ul {list-style-type: circle;}.
For other style types, see the reference.
I'm having some issues when it comes to formatting a webapp I'm working. For some reason when I try to display a table next to a tree it shoves it under the tree instead of beside it.
Considering I haven't made a website since 1998 I think I'm doing ok, but anyway here's the code.
<div style="height:55px;border-bottom: 1px solid black;float:top;">
<div id="menu_div" style="height:50px;width:200px;margin-top:15px;margin-bottom:15px;display:inline-block;">
<ul id="menu">
<li>Menu
<ul>
<li>Configure IP</li>
<li>Configure Local Share</li>
<li>Send Files Now</li>
<li>Allow Remote Access</li>
<li>Add Source
<ul>
<li>MySQL</li>
<li>MSSQL</li>
<li>Remote Share</li>
</ul>
</li>
<li>Refresh Local Share</li>
<li>Backup Device</li>
</ul>
</li>
</ul>
</div>
<div style="float:right;margin-top:10px;display:inline-block;">
<span style="vertical-align:middle;margin-left:20px;"><img src="png/glyphicons_457_transfer.png" /></span>
<span id="deletePic" style="vertical-align:middle;margin-left:20px;"><img src="png/glyphicons_256_delete.png" /></span>
</div>
</div>
<div id="lower">
<div id="mainCon" style="width:300px;height:100%;border-right: 1px solid black;float:left;display:inline-block;">
<div id="browser"></div>
<div id="subBrowser"></div>
</div>
<div>
<div style="float:right;margin-left:320px;display:inline-block;">
<div id="displayTable"></div>
<pre><p style="margin-left:10px;" id="displayText"></p></pre>
</div>
</div>
</div>
Let's say I have the mark-up like this:
<ul id="comments">
<li class="comment">
<div class="author">on Friday 3th, Jenny said:</div>
<div class="content"><p>bla bla</p></div>
</li>
<li class="comment">
<div class="author">on Friday 3th, Jenny said:</div>
<div class="content"><p>bla bla</p></div>
<ul class="level-2">
<li class="comment">
<div class="author">on Friday 3th, Mary said:</div>
<div class="content">stfu jenny</div>
</li>
</ul>
</li>
...
How do I use the "UserComments" item on this mark-up ?
http://schema.org/UserComments
Where do I add itemscope itemtype="http://schema.org/UserComments" ? Once on the list container, or multiple times on each list item?
You shouldn't be using itemprop="name", but instead use "creator".
More examples... http://homebiss.blogspot.com/2011/11/schema-markups-blogger-comments.html
According to the HTML5 Microdata typed items specs, you would add it to the container of your comments section, e.g.
<section itemscope itemtype="http://example.org/animals#cat">
<h1 itemprop="name">Hedral</h1>
<p itemprop="desc">Hedral is a male american domestic
shorthair, with a fluffy black fur with white paws and belly.</p>
<img itemprop="img" src="hedral.jpeg" alt="" title="Hedral, age 18 months">
</section>
So the item scope for your comment section would be formatted like this (taking into account the item properties):
<ul id="comments" itemscope itemtype="http://schema.org/UserComments">
<li class="comment">
<div itemprop="name" class="author"><span itemprop="commentTime">on Friday 3th</span>, Jenny said:</div>
<div itemprop="commentText" class="content"><p>bla bla</p></div>
</li>
<li class="comment">
<div itemprop="name" class="author"><span itemprop="commentTime">on Friday 3th</span>, Jenny said:</div>
<div itemprop="commentText" class="content"><p>bla bla</p></div>
<ul class="level-2">
<li class="comment">
<div itemprop="name" class="author"><span itemprop="commentTime">on Friday 3th</span>, Mary said:</div>
<div itemprop="commentText" class="content">stfu jenny</div>
</li>
</ul>
</li>
...
Each comment would be an own item (UserComments in your example). You might also want to use an article element for each comment.
<article itemscope itemtype="http://schema.org/UserComments">
<header>
on
<time itemprop="commentTime" datetime="…">Friday 3th</time>,
<span itemprop="creator" itemscope itemtype="http://schema.org/Person">
<span itemprop="name">Jenny</span>
</span>
said:
</header>
<p itemprop="commentText">bla bla</p>
</article>
However, now there is also Comment, which seems to be more appropriate because it’s a CreativeWork (and not an Event, like UserComments).
Due to schema.org, It is good to change using userComments to Comment:
UserInteraction and its subtypes is an old way of talking about users interacting with pages. It is generally better to use Action-based vocabulary, alongside types such as Comment.
But you can use this item by adding commentText property and creator as a person to it.