<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ben Tran on Medium]]></title>
        <description><![CDATA[Stories by Ben Tran on Medium]]></description>
        <link>https://medium.com/@BenTranCodes?source=rss-36993e402842------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*pYFDTVvNkICCVUu_.jpg</url>
            <title>Stories by Ben Tran on Medium</title>
            <link>https://medium.com/@BenTranCodes?source=rss-36993e402842------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 09:08:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@BenTranCodes/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Choosing Good Names]]></title>
            <link>https://medium.com/@BenTranCodes/choosing-good-names-79077a4c8481?source=rss-36993e402842------2</link>
            <guid isPermaLink="false">https://medium.com/p/79077a4c8481</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[Ben Tran]]></dc:creator>
            <pubDate>Mon, 06 Feb 2017 04:31:05 GMT</pubDate>
            <atom:updated>2017-02-06T04:31:05.649Z</atom:updated>
            <content:encoded><![CDATA[<p>When styling with CSS, you specify which tags you want to style and what sort of styling you wish to do. You can select any elements that you have in the HTML file and style it with different attributes depending on the element selected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*DgdZ4TLZfcZ9PJfVlY-5JQ.png" /><figcaption>Example 1</figcaption></figure><p>In the example above, we’re selecting the body element to style and changing the font color (or colour for my British readers) to dark cyan.</p><p>There are also selectors called “Class” and “ID” which you can use to group up elements which you want to style. To use them you’ll need to assign a name to a class or ID and select which elements you want to belong to this class.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0elnpaNCxurCCosfjzineQ.png" /><figcaption>Example 2</figcaption></figure><p>In the example above, we created “class1” and “class2”. You can also see that we’ve selected each of the classes in the CSS section and gave them different colors as well. With the use of classes and ID’s it allows the use to further style webpages to how we want by grouping elements.</p><p>One of the most important things to note when using classes and ID’s is to provide a descriptive and meaningful name to identify with. This way when you’ve created over 20 different classes you’ll still remember which elements they affect without being confused. You definitely don’t want to be caught in a situation where you have to go through your code looking for which elements are part of that “cohort13” class which you created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*vLjDC3fxDTgvwuNQJh6W2Q.gif" /><figcaption>Source: <a href="http://www.reactiongifs.com/picard-facepalm/">http://www.reactiongifs.com/picard-facepalm/</a></figcaption></figure><p>It really is important to keep your class and ID names meaningful as it’ll help you keep track of your code. While working on a few projects I found myself falling into more situations where I got lost and confused with the classes because of the names that I’ve assigned. That’s when I came across “BEM”.</p><p>“BEM” stands for Block Element Modifier. It’s a methodology that was created by Yandex, one of the biggest Russian internet companies, to help keep things easy to use, modular enough to be reusable, and flexible to be configured to the way you like.</p><p>The concept of how BEM works is to view the website as blocks. In the example below there you can see there is a green box. This green box is considered a “Block”. The blue boxes inside of that represents different “Elements” within such as the logo, search bar and buttons.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4W-n8GfJk7gf5ceZVZghsQ.png" /><figcaption>Example 3. Amazingly drawn box layout</figcaption></figure><p>The last thing BEM covers is “Modifiers”. Modifiers change the properties of the block or element causing a change in either looks or behaviour. It may also be noted that several modifiers may be used on a block.</p><p>For more information and examples they can be found via <a href="http://getbem.com/naming/">http://getbem.com/naming/</a> . The page goes into more detail such as recommended names for blocks, elements and modifiers, and also provide some good and bad examples of BEM.</p><p>Feel free to leave me any questions you may have and I’ll gladly answer them.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79077a4c8481" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>