<?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 Emre Yilmaz on Medium]]></title>
        <description><![CDATA[Stories by Emre Yilmaz on Medium]]></description>
        <link>https://medium.com/@ymzEmre?source=rss-80a0453bc190------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*c_eB-4BCnERyW3DZOJ5vkw.png</url>
            <title>Stories by Emre Yilmaz on Medium</title>
            <link>https://medium.com/@ymzEmre?source=rss-80a0453bc190------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 18:07:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ymzEmre/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[Golden Handcuffs: Is It Really Worth It?]]></title>
            <link>https://medium.com/@ymzEmre/golden-handcuffs-is-it-really-worth-it-64eeb39eeadc?source=rss-80a0453bc190------2</link>
            <guid isPermaLink="false">https://medium.com/p/64eeb39eeadc</guid>
            <dc:creator><![CDATA[Emre Yilmaz]]></dc:creator>
            <pubDate>Sun, 09 Jun 2024 03:02:35 GMT</pubDate>
            <atom:updated>2024-06-10T20:24:18.580Z</atom:updated>
            <content:encoded><![CDATA[<p>Golden handcuffs play an important role as a strategy for organizations to retain talented employees. They are financial incentives designed to make it difficult for employees to leave, aiming to keep them within the company. While these incentives can effectively retain valuable talent, they also come with disadvantages for both employees and organizations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*RZOmkZU5teQUC9f2LavXTQ.jpeg" /></figure><blockquote><strong>Don’t change horses in midstream.</strong></blockquote><p>While it may seem like a good strategic tactic, it doesn’t always work out for the best. Let’s now examine the following two scenarios as examples.</p><ol><li>If Jessica is already satisfied with her financial situation but unhappy with other aspects within the company, employing this tactic to prevent her departure may seem like a gain for the company at first glance, but it could actually lead to a loss. In this scenario, Jessica remains with the company solely for financial reasons, while her inefficiency, performance issues, and low motivation persist. If Jessica is truly a key employee, working on projects with impending deadlines or in a bus factor situation, this tactic might be applied as a short-term solution. I say “short-term” because in this case, the tactic acts as a pain reliever; once its effect wears off, Jessica’s departure becomes inevitable because Jessica’s issue is not financial.</li><li>Exactly, in a situation where Jessica is content with her team members, the work environment, company culture, and other aspects but is dissatisfied with the financial aspects, this tactic could work exceptionally well.</li></ol><h3><strong>Types of Golden Handcuffs</strong></h3><p><strong>High Salaries —</strong> Employees are incentivized to stay in the company by offering them high salaries or bonuses.</p><p><strong>Stock Options — </strong>Employees are granted the right to purchase company stock at a discounted price after a certain period. If the employee leaves before this period, they forfeit this right.</p><p><strong>Restricted Stock Units (RSU) — </strong>Employees are given company shares, but these become usable only after a certain period. If the employee leaves, they lose the shares.</p><p><strong>Pension Plans —</strong> Employees who stay with the company for a long time receive additional payments during retirement. Early departure results in forfeiting these payments.</p><p><strong>Bonuses and Incentives —</strong> Additional payments given to employees conditional on their staying with the company for a certain period. If the employee leaves early, they do not benefit from these payments.</p><p><strong>Long-Term Incentive Plans (LTIP) — </strong>Performance-based long-term incentives, typically paid out after 3–5 years with the condition of remaining with the company during that period.</p><p><strong>Career Development and Training Opportunities —</strong> Special training programs, certifications, or advanced education opportunities are offered to employees for career advancement.</p><p><strong>Property Rights —</strong> Employees may be granted long-term usage rights over company property or assets, valid as long as the employee continues to work for the company.</p><p><strong>Housing Allowances — </strong>Financial assistance provided by employers to cover employees’ housing expenses.</p><p><strong>Company Housing —</strong> Housing provided by employers, either owned or leased by the company, for employees.</p><p><strong>Profit Sharing —</strong> Employees receive a portion of the company’s profits. This incentive is often long-term planned and increases with the employee’s tenure.</p><p><strong>Vacations and Travel Incentives —</strong> Extra vacation days or company-funded paid vacations are offered to employees after a certain period of tenure with the company.</p><h3><strong>Conclusion</strong></h3><p>At first, golden handcuffs can motivate employees by providing a clear financial incentive to stay. However, over time, if the primary reason for their stay becomes financial rather than job satisfaction, they may feel trapped. This can lead to a decrease in motivation and productivity. Additionally, when someone is put under golden handcuffs, other employees who become aware of this situation may want to benefit from it.</p><p>Ensure that you apply this tactic to the <strong>right person</strong>, <strong>at the right time</strong>, and in the <strong>right manner</strong>, or else you may incur significant unnecessary costs for the company.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64eeb39eeadc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Project Disaster — Bus Factor]]></title>
            <link>https://medium.com/@ymzEmre/project-disaster-bus-factor-8d96893a32aa?source=rss-80a0453bc190------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d96893a32aa</guid>
            <category><![CDATA[bus-factor]]></category>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[management]]></category>
            <category><![CDATA[project-management]]></category>
            <dc:creator><![CDATA[Emre Yilmaz]]></dc:creator>
            <pubDate>Wed, 01 May 2024 03:01:34 GMT</pubDate>
            <atom:updated>2024-08-07T17:10:27.601Z</atom:updated>
            <content:encoded><![CDATA[<h3>Project Disaster — Bus Factor</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qf6_4EAcSw4D-G0J24ZVxg.jpeg" /></figure><p>The term <strong>bus factor </strong>refers to the number of key individuals in an organization or project team whose sudden departure, like being <strong>hit by a bus</strong>, would significantly impact the continuity, success and techical capabilities of the project.</p><p>If a project has a low bus factor number, it means that it is heavily dependent on only a few individuals. In the event taht any these key individuals are no longer involved in the project (like in the case of being hit by a bus), the project is vulnerable and unprepared for distruptions and problems in the process.</p><h3>How To Detect The Presence The Of The Bus Factor?</h3><ol><li>Are there any team members who specialize in a particular area or technology? If so, how many people are there?</li><li>If any of these individuals were to unexpectedly leave the project, what scenarious could arise?</li><li>If there a culture of sharing knowledge and experience among team members?</li><li>How clearly defined are the roles responsibilities of everyone working on the project? In the event of a team member being incapacitated, could their roles and responsibilities be easily transferred to someone else?</li><li>How well documented are the project documents and codebase?</li></ol><h3>What Could It Lead To?</h3><ul><li>In a software company, if a software engineer who is the only one developer of a specific module unexpectedly leaves, the maintenance and development of that module are significantly affected.</li><li>If an open-source project has only one developer and that developer somehow leaves the project, the project continuity and maitenance are greatly endangered.</li></ul><p>These situations are not only seen in software companies, the can occur everywhere in daily life.</p><p>For instance, Charlotte has been the head chef of a restaurant for many years. She plays a significant role in all processesm from creating menus to preparing meals. Charlotte is the only who knows the detailed recipes of the restaurant’s best dishes and she only gives general instructions to the staff. In this case, Charlotte’s <strong>bus factor </strong>in the restaurant is quite high. So, if she were to unexpectedly leave, her lack of her knowledge and experience could seriously affect the operation of the restaurant.</p><h3>Prevent Before The Bus Hits</h3><blockquote>DON’T ENGAGE IN EGO GRATIFICATION AND STOP THOSE WHO DO.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*YYPz7JUiCx7Le0Y-_FxNjw.jpeg" /></figure><p>Whether you’re a team member or a team leader, your expertise in a subject and your know-how;</p><p><strong>I will lose my seat.</strong></p><p><strong>My reputation will decrease.</strong></p><p><strong>This is something special and can only be done by me and people with my IQ level.</strong></p><p>Dont be <strong>AFRAID</strong> to share, for reasons such as.</p><p><strong>Intra-team communication</strong></p><p>Regular, healthy communication and information sharing among team members have many advantages, such as increasing the bus factor.</p><p><strong>Documentation</strong></p><p>Documenting important information such as the project’s codebase, architecture, algorithms and design decisions enables team members to quickly adapt to the project and with these documents, the project flow can continue.</p><p><strong>Code review, mob and pair programming</strong></p><p>These practices can increase knowledge sharing among team members and improve the overall quality of the codebase. They can help team members understand each other’s work and enhance their knowledge.</p><p><strong>Organize workshops</strong></p><p>They allow participants to share their experiences and learn from each other. Participants from different backgrounds find and opportunity to understand each other’s perspectives and see different viewpoints. Additionally, it helps them develop teamwork, communication and collaboration skills.</p><p><strong>Rotational task distribution</strong></p><p>Task rotation among teams can be implemented to ensure that specific tasks are not solely dependent on onde individual. In this way, everyone gains experience in different areas and becomes familiar with various parts of the project. Of consider a mobile development team 10 people; not just one person should be familiar with the processes of publishing the application to the store. Everyone in the team can share knowledge with each other to ensure that everyone is familiar with the processes of publishing the application to the store.</p><p><strong>Task balancer</strong></p><p>To reduce risks in the project development process, distribute the workload equally and evenly among team members. This way, the number of knowledgeable and exprienced individuals in specific areas increases, thereby increases the bus factor number.</p><h3>Conclusion</h3><p>The bus factor, is an important measure that determines how fragile a project is. It indicates how much the project would be affected if a key person (such as a specific expert or leader) unexpectedly left the project. A high bus factor number means that multiple people possess critical lead to a <a href="https://en.wikipedia.org/wiki/Single_point_of_failure">single point of failure</a>, jeopardizing the project’s stability. Therefore, evaluating and improving the bus factor number of projects is crucial for reducing risks and ensuring continuity.</p><p>We have come to end of this article, see you again in another article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d96893a32aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[System Design — CAP Theorem]]></title>
            <link>https://medium.com/@ymzEmre/system-design-cap-theorem-55141c50fe2a?source=rss-80a0453bc190------2</link>
            <guid isPermaLink="false">https://medium.com/p/55141c50fe2a</guid>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[cap-theorem]]></category>
            <dc:creator><![CDATA[Emre Yilmaz]]></dc:creator>
            <pubDate>Fri, 19 Apr 2024 20:50:23 GMT</pubDate>
            <atom:updated>2024-04-25T12:37:05.320Z</atom:updated>
            <content:encoded><![CDATA[<h3>System Design — CAP Theorem</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*gds3NhS7i7-uzdU6L8qbKA.png" /></figure><p>CAP theorem, proposed by computer scientist <a href="https://en.wikipedia.org/wiki/Eric_Brewer_(scientist)">Eric Brewer</a> in 2000 year. The CAP theorem is a theory that plays a crucial role in distributed systems, database management and design. According to the CAP theorem, when designing a distributed system, consistency, availability and partition tolerance are three crucial aspects. The theorem states that it’s impossible for a distributed system to simultaneously guarantee all three properties, only two can be guaranteed at any given time. Therefore, when designing a distributed system, trade-off among these properties must be made.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*mC5bSR3ExXwPeyhe-b0Q7A.jpeg" /></figure><h3><strong>Consistency</strong></h3><p>All nodes in the system have the same data at the same data, regardless of which node is accessed.</p><p>In other words, when a data update or transaction occurs, all subsequent accesses to that data will reflect the most recent update, regardless of which node in the system is accessed. In this way, the system ensures that the data is always up-to-date and consistent.</p><p>I will provide all examples based on a banking system.</p><p>For instance;</p><p>In a banking system, consistency ensures that when you deposit money into your account, the balance is immediately updated and reflected accurately accross all systems. For instance, if you deposit $100 into your account, you expect to see that balance reflected across all platforms (Online banking, mobile application, ATM and bank statements). Consistency, ensures that there are no discrepancies in your balance, regardless of which platform you use to access it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-pCziXuRhU4V8Ce0" /><figcaption>Photo by <a href="https://unsplash.com/@scottrodgerson?utm_source=medium&amp;utm_medium=referral">Scott Rodgerson</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Availability</h3><p>Evert request receives a response, without guarantee that it contains the most recent data.</p><p>For instance;</p><p>If we consider an example from the banking system, when we want to transfer money to another account, various methods are available such as mobile banking, internet banking, telephone banking or braches. Assuming maintenance is being conducted on the bank’s mobile application, we can continue our transaction using other methods. As a result, at any time, I can access my account, view my balance, and make transactions using any method available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*0yq-qWf8KM4kfp5BEMx3NA.png" /></figure><h3>Partition Tolerance</h3><p>The system is suitable for network partitions. It continues to function despite communication interruptions between nodes. Crucial for ensuring uninterrupted service delivery even in the face of network failures or partitions</p><p>For instance;</p><p>In a banking system, if there’s network partition between an ATM and the bank’s central server, the ATM should still be able to perform basic transactions, such as cash withdrawals or balance inquiries, using locally cached data or by communicating with nearby servers. Once the network connectivity is restored, the ATM can synchronize transaction data with the central server to maintain consistency across the system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*DDj0W3c7i7YcUJifr-371A.png" /></figure><h4><strong>1. If availability and partition tolerance are prioritized, consistency cannot be guaranteed.</strong></h4><p>In this case, availability and network partitions are prioritized over data consistency. This means that a change made to the database continues even in the event of a network partition where some node cannot reach others. This implies that some data copies in the system may not be up-to-date, or some users may not have access to the most current data.</p><p>For instance;</p><p>In a banking system, customers can always view their account balances and make transactions, but real-time data consistency among all nodes in the system may not be guaranteed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*kZ--yAXr4I1r8y-X6VV7EA.png" /></figure><h4><strong>2. If consistency and availability are prioritized, partition tolerance cannot be guaranteed.</strong></h4><p>In this case, the system prioritizes consistency and availability over resilience to network partitions. The means that all nodes in the system can always access up-to-date data, but the system may become unavailable when there is a network partitions.</p><p>For instance;</p><p>When there is network partition or a server failure, the system may become unavailable. In this case, users may be offline for a certain period and may not have access to their account information. However, after the network issue is resolved, synchronization occurs with the current data in the system, and users can perform their transactions normally. In this scenario, while the system focuses on ensuring consistency and availability for users, services become temporarily unavailable in the event of any network partition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*uuR7Vh2xEvzKZgOdwA5u2A.png" /></figure><h4><strong>3. If consistency and partition tolerance are prioritized, availability cannot be guaranteed.</strong></h4><p>In this case, system prioritiez consistency and resilience to network partitions but neglects availability. This means taht the system strives to maintain consistency among all nodes, but services may become temporarily unavailable when tehre is a network disruption. When the system resumes operation, accounts become accessible again with up-to-date data.</p><p>For instance;</p><p>Let’s consider an international money transfer system a bank, The system utilizes a distributed architecture to keep account balances updated across all nodes. However, in the event of a network partition, users may not be able to perform money transfer transactions. Nevertheless, when the network reconnects, the accounts are reconciled with the latest data and transactions become possible again.</p><h3>Conclusion</h3><p>In conclusion, the CAP theorem is a significant concept that aids in understanding the challenges encountered in the design of distributed systems and in determining the necessary strategies to manage these challenges. This theorem enables system designers to develop a balanced approach between consistency, availability and network partitioning.</p><p>We have come to end of this article, see you again in another article.</p><h3><strong>Sources</strong></h3><ul><li><a href="https://www.ibm.com/topics/cap-theorem">What Is the CAP Theorem? | IBM</a></li><li><a href="https://en.wikipedia.org/wiki/CAP_theorem">CAP theorem - Wikipedia</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55141c50fe2a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CSS — Pseudo Elements]]></title>
            <link>https://medium.com/@ymzEmre/css-pseudo-elements-8f6048915432?source=rss-80a0453bc190------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f6048915432</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[pseudo-element]]></category>
            <category><![CDATA[css-selectors]]></category>
            <category><![CDATA[css-pseudo-elements]]></category>
            <dc:creator><![CDATA[Emre Yilmaz]]></dc:creator>
            <pubDate>Sat, 16 Apr 2022 10:19:43 GMT</pubDate>
            <atom:updated>2022-04-16T10:19:43.618Z</atom:updated>
            <content:encoded><![CDATA[<h3>CSS — Pseudo Elements</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ui-Bcp1a32Z8LbugT6AUzQ.png" /></figure><p>Hi everyone,</p><p>Welcome to chapter-4 of a series of articles where I will tell you about all selectors in CSS.</p><p>I will tell you what are <strong>pseudo-elements </strong>in this section.</p><h4>5) Pseudo elements</h4><p>The :: pseudo represent entities that are not included in HTML.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7736c018ca040e6236917fd736d18477/href">https://medium.com/media/7736c018ca040e6236917fd736d18477/href</a></iframe><h4>::after</h4><p>Creates a pseudo-element that is the last child of the selected element.</p><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*uOdJoZ6CmNXQ4vBrbRwAjg.jpeg" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2976fd5f8e825c2a3c5df84897866e17/href">https://medium.com/media/2976fd5f8e825c2a3c5df84897866e17/href</a></iframe><h4>::before</h4><p>Creates a pseudo-element that is the first child of the selected element.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9a00de7f8ea86866b808a0a0f9c86477/href">https://medium.com/media/9a00de7f8ea86866b808a0a0f9c86477/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*ZUTxCuKegxilY4rrcYVKNg.jpeg" /></figure><h4>::cue</h4><p>Matches WebVTT cues within a selected element. This can be used to style captions and other cues in media with VTT tracks.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/60fdfcacc81c48ae60c852fd0046b56b/href">https://medium.com/media/60fdfcacc81c48ae60c852fd0046b56b/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*dAk9Ifp1vbhDBu6D_tKrEg.jpeg" /></figure><p>— <strong>WebVTT (Web Video Text Tracks Format)</strong></p><p>WebVTT is a format for displaying timed text tracks (such as subtitles or captions) using the &lt;track&gt; element. The primary purpose of WebVTT files is to add text overlays to a &lt;video&gt;.</p><p>— <strong>Example WebVTT file</strong></p><pre>WEBVTT</pre><pre>00:01.000 --&gt; 00:05.000<br>- Example subtitle-1</pre><pre>00:06.000 --&gt; 00:10.000<br>- Example subtitle-2</pre><pre>00:11.000 --&gt; 00:15.000<br>- Example subtitle-3</pre><p>— <strong>&lt;track&gt;</strong></p><p>The &lt;track&gt; HTML element is used as a child of the media elements, &lt;audio&gt; and &lt;video&gt;. It lets you specify timed text tracks, for example to automatically handle subtitles.</p><h4>::first-letter</h4><p>Applies styles to the first letter of the first line of a block-level element.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f220c880e016bbd603c0be37bdeccb70/href">https://medium.com/media/f220c880e016bbd603c0be37bdeccb70/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*ljQHbAvzc3Rj_P2Fu-52nQ.jpeg" /></figure><h4>::first-line</h4><p>Applies styles to the first line of a block-level element.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/126002caa4a32df0eaa4100af0ea1109/href">https://medium.com/media/126002caa4a32df0eaa4100af0ea1109/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*HUkuYFbu5F7Ob7KGf5xDLw.jpeg" /></figure><h4>::file-selector-button</h4><p>Represents the button of an &lt;input&gt; of type=&quot;file&quot;.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4673aa4ea6ddd7f464911b24b345f0b8/href">https://medium.com/media/4673aa4ea6ddd7f464911b24b345f0b8/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*EJoaR1qpSt71wDEaRVmjKQ.jpeg" /></figure><h4>::marker</h4><p>Selects the marker box of a list item, which contains a bullet or number.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cfbc232073401b7272ff7c335ac0ac2a/href">https://medium.com/media/cfbc232073401b7272ff7c335ac0ac2a/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*AhP3ZOBefD_xSdRBgfd_Hw.jpeg" /></figure><h4>::placeholder</h4><p>Represents the placeholder text in an &lt;input&gt; or &lt;textarea&gt; element.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ae574322ffcb0e6c2d0a5bc0d5f441ac/href">https://medium.com/media/ae574322ffcb0e6c2d0a5bc0d5f441ac/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*UBUxi2roVHH00h-TPkLRQQ.jpeg" /></figure><h4>::selection</h4><p>Applies styles to the part of a document that has been highlighted by the user (such as clicking and dragging the mouse across text).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d6d3d975bc6ce07ed70cdcf7a176fab6/href">https://medium.com/media/d6d3d975bc6ce07ed70cdcf7a176fab6/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*vtixJrbr_NEicEu2tcjBCw.jpeg" /></figure><p>For all the examples in this section, visit.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2F9zlffy&amp;display_name=CodeSandbox&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2F9zlffy&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2F9zlffy%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/126f537402e1dd9ae7ee6965ba4ac25b/href">https://medium.com/media/126f537402e1dd9ae7ee6965ba4ac25b/href</a></iframe><p>You have come at the end of my article where I tell all the selectors in CSS. I hope that will be useful.</p><p><strong>Resource</strong></p><p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS">CSS: Cascading Style Sheets | MDN</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f6048915432" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CSS — Pseudo Classes]]></title>
            <link>https://medium.com/@ymzEmre/css-pseudo-classes-9b6edcbc2d41?source=rss-80a0453bc190------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b6edcbc2d41</guid>
            <category><![CDATA[pseudo-class]]></category>
            <category><![CDATA[css-selectors]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[css-pseudo-class]]></category>
            <dc:creator><![CDATA[Emre Yilmaz]]></dc:creator>
            <pubDate>Fri, 15 Apr 2022 23:03:11 GMT</pubDate>
            <atom:updated>2022-04-17T23:57:30.692Z</atom:updated>
            <content:encoded><![CDATA[<h3>CSS — Pseudo Classes</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dpo10ZqDKx09GDhrsax6mQ.png" /></figure><p>Hi everyone,</p><p>Welcome to c<em>hapter-</em>3 of a series of articles where I will tell you about all selectors in CSS.</p><p>I will tell you what are <strong>pseudo-classes </strong>in this section.</p><h3>4) Pseudo-classes</h3><p>The : pseudo allow the selection of elements based on state information that is not contained in the document tree.</p><p><strong><em>— Syntax</em></strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6216d829f4d16df54a521463ae476f1e/href">https://medium.com/media/6216d829f4d16df54a521463ae476f1e/href</a></iframe><h4>4.1) Linguistic pseudo-classes</h4><p>These pseudo-classes reflect the document language, and enable the selection of elements based on language or script direction.</p><h4>:lang</h4><p>Matches elements based on the language they are determined to be in.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a60136ede3189c5b0c6a09d1789f95c7/href">https://medium.com/media/a60136ede3189c5b0c6a09d1789f95c7/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*fAT1SrmmLRj7iTPFBUhc9A.jpeg" /></figure><h4>4.2) Location pseudo-classes</h4><p>These pseudo-classes relate to links, and to targeted elements within the current document.</p><h4>:any-link</h4><p>Matches an element if the element would match either :link or :visited.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8010d640ad10afe02e5b51725636798d/href">https://medium.com/media/8010d640ad10afe02e5b51725636798d/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*sqHJ_cnsZJULLRO7DGDzEA.jpeg" /></figure><h4>:link</h4><p>Matches links that have not yet been visited.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2a478c9d974ff248df78548e1d39e422/href">https://medium.com/media/2a478c9d974ff248df78548e1d39e422/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*_k7IraJx-ke9pw_P-b7fFA.jpeg" /></figure><h4><strong>:visited</strong></h4><p>Matches links that have been visited.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0ed166788f12e0f74e723d611d411b95/href">https://medium.com/media/0ed166788f12e0f74e723d611d411b95/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*a11_BQOkosQXmXa9xnoaTg.jpeg" /></figure><h4><strong>:target</strong></h4><p>Matches the element which is the target of the document URL.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f4ca44b99b1493cd4f2be10bf216ae84/href">https://medium.com/media/f4ca44b99b1493cd4f2be10bf216ae84/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*-11vO-uLYdn-CgcPqdzuwQ.jpeg" /></figure><h4><strong>4.3) User action pseudo-classes</strong></h4><p>These pseudo-classes require some interaction by the user in order for them to apply, such as holding a mouse pointer over an element.</p><h4><strong>:hover</strong></h4><p>Matches when a user designates an item with a pointing device, for example holding the mouse pointer over it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/644f1cec059822e9feca4ddfc6347553/href">https://medium.com/media/644f1cec059822e9feca4ddfc6347553/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*rMeiJXffpxVaDEgL6tSppg.jpeg" /></figure><h4>:active</h4><p>Matches when an item is being activated by the user, for example clicked on.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dae79e4b8c815843e72c6b810c4969c8/href">https://medium.com/media/dae79e4b8c815843e72c6b810c4969c8/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*QT_CKyC1Y3MgdV92DRM2TA.jpeg" /></figure><h4>:focus</h4><p>It is triggered when the user clicks or taps on an element or selects it with the keyboard’s Tab key.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e49ee6839e06e41eb37addf9b46ebb73/href">https://medium.com/media/e49ee6839e06e41eb37addf9b46ebb73/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*7nETNtOmIkSsUax6NGEOhg.jpeg" /></figure><h4>:focus-visible</h4><p>Matches when an element has focus and the user agent identifies that the element should be visibly focused. (It is triggered selects it with the keyboard’s Tab key.)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c7d77f60be4517604ca6fbe2d35f4098/href">https://medium.com/media/c7d77f60be4517604ca6fbe2d35f4098/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*XowiKhtw5GoeNuLZA8AYQA.jpeg" /></figure><h4>:focus-within</h4><p>Matches an element if the element or any of its descendants are focused.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7c47d35690ce3e3a91a6383355be7019/href">https://medium.com/media/7c47d35690ce3e3a91a6383355be7019/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*B-N_w8AK-u_KxMXoz_noew.jpeg" /></figure><h4>4.4) The input pseudo-classes</h4><h4>:autofill</h4><p>Matches when an &lt;input&gt; has been autofilled by the browser. The class stops matching if the user edits the field.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2a89928769dcff19835f78ab90579397/href">https://medium.com/media/2a89928769dcff19835f78ab90579397/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*RM1ZFzEI29jYMS3ajwRGsQ.jpeg" /></figure><h4>:enabled</h4><p>Represents any enabled element. An element is enabled if it can be activated (selected, clicked on, typed into, etc.) or accept focus.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a0e8f9d57a8b1164fa42017669d08dfd/href">https://medium.com/media/a0e8f9d57a8b1164fa42017669d08dfd/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*wzMoGPDXq939-H1Fb1AC-Q.jpeg" /></figure><h4>:disabled</h4><p>Represents any disabled element. An element is disabled if it can’t be activated (selected, clicked on, typed into, etc.) or accept focus.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aa1c83e6e490d5dcd82e203c0ddb0e8a/href">https://medium.com/media/aa1c83e6e490d5dcd82e203c0ddb0e8a/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*xaA-Nqe1f9GFDKg0vQFoog.jpeg" /></figure><h4>:read-only</h4><p>Represents an element (such as input or textarea) that is not editable by the user.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/53bc48c05f083e4b72d50be54f9eabd7/href">https://medium.com/media/53bc48c05f083e4b72d50be54f9eabd7/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*OX0AsZW0pduZn2_XfxEc5A.jpeg" /></figure><h4>:read-write</h4><p>Represents an element that is editable by the user.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/717ba8363b622d30f9aa5c885bc05189/href">https://medium.com/media/717ba8363b622d30f9aa5c885bc05189/href</a></iframe><p>We have given contenteditable attribute to the &lt;p&gt; tag, the text in it can be changed by the user.</p><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*0n4zjTlk4vicUawPaq6Qew.jpeg" /></figure><h4>:placeholder-shown</h4><p>Represents any &lt;input&gt; or &lt;textarea&gt; element that is currently displaying placeholder text.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/515d080d03d2d3408f5c6eccf77267c8/href">https://medium.com/media/515d080d03d2d3408f5c6eccf77267c8/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*jO9BYtugqIMXdo1WxAtQOw.jpeg" /></figure><h4>:default</h4><p>Selects form elements that are the default in a group of related elements. It may match the &lt;button&gt;, &lt;input type=&quot;checkbox&quot;&gt;, &lt;input type=&quot;radio&quot;&gt;, and &lt;option&gt; elements:</p><ul><li>&lt;input type=&quot;checkbox&quot;&gt; and &lt;input type=&quot;radio&quot;&gt; match if they have the checked attribute.</li><li>A default option element is the first one with the selected attribute, or the first enabled option in DOM order. multiple &lt;select&gt;s can have more than one selected option, so all will match :default.</li><li>Matches if it is a &lt;form&gt;’s first default submission button</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0e13c5d21139ac1b3c9933dd2b6ac14f/href">https://medium.com/media/0e13c5d21139ac1b3c9933dd2b6ac14f/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nAMLj2qI5Ue3-g5zY211qg.jpeg" /></figure><h4>:checked</h4><p>Represents any radio &lt;input type=&quot;radio&quot;&gt;, checkbox &lt;input type=&quot;checkbox&quot;&gt;, or option &lt;option&gt; in a &lt;select&gt; element that is checked or toggled to an on state.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/542a0e6f4bf9a9e8869e80a93b47cc3a/href">https://medium.com/media/542a0e6f4bf9a9e8869e80a93b47cc3a/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*kg7A1XCYt3FaJo9TV4Z42Q.jpeg" /></figure><h4>:indeterminate</h4><p>The :indeterminate CSS pseudo-class represents any form element whose state is indeterminate, such as checkboxes which have their HTML indeterminate attribute set to true, radio buttons which are members of a group in which all radio buttons are unchecked, and indeterminate &lt;progress&gt; elements.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1cba42ae1d2eda39c2f2a26d49f5925b/href">https://medium.com/media/1cba42ae1d2eda39c2f2a26d49f5925b/href</a></iframe><p>We gave the checkbox elements the property indeterminate=true with JavaScript.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/409a4b2a19dddf509143c2ecfebfc01b/href">https://medium.com/media/409a4b2a19dddf509143c2ecfebfc01b/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X9m-9DhEKOGzk5oSC7qNag.jpeg" /></figure><p>— After the selection</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MZSV-Xea3y7xDorik0h7Ig.jpeg" /></figure><h3>:valid &amp; :invalid</h3><p><strong>:valid </strong>: Represents any &lt;input&gt; or other &lt;form&gt; element whose contents validate successfully. This allows to easily make valid fields adopt an appearance that helps the user confirm that their data is formatted properly.</p><p><strong>:invalid </strong>: Represents any &lt;form&gt;, &lt;input&gt; or other &lt;form&gt; element whose contents fail to validate. Is useful for highlighting field errors for the user.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/791418e1b0819f9daab34ce230d8f1e8/href">https://medium.com/media/791418e1b0819f9daab34ce230d8f1e8/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*ps1v2t3ESGduFEGYvtDh1w.jpeg" /></figure><h4>:in-range</h4><p>Represents an &lt;input&gt; element whose current value is within the range limits specified by the min and max attributes. Useful for giving the user a visual indication that a field’s current value is within the permitted limits.</p><blockquote>Only applies to elements that have (and can take) a range limitation. In the absence of such a limitation, the element can neither be in-range nor out-of-range</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d44ba20ddb1a6017b89ce1d0b30a67a9/href">https://medium.com/media/d44ba20ddb1a6017b89ce1d0b30a67a9/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*Z6zRPvdn73Q0DlSDCqam9g.jpeg" /></figure><h4>:out-of-range</h4><p>Represents an &lt;input&gt; element whose current value is outside the range limits specified by the min and max attributes. Useful for giving the user a visual indication that a field’s current value is outside the permitted limits.</p><p>only applies to elements that have (and can take) a range limitation. In the absence of such a limitation, the element can neither be in-range nor out-of-range</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3da07058902f3f2666a24c1fcad781dd/href">https://medium.com/media/3da07058902f3f2666a24c1fcad781dd/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*L-tSAzkacf9FPhHFPvQT8w.jpeg" /></figure><h4>:required</h4><p>Represents any &lt;input&gt;, &lt;select&gt;, or &lt;textarea&gt; element that has the required attribute set on it. Useful for highlighting fields that must have valid data before a form can be submitted.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3a375196baabc1e35b97edf0c8290c03/href">https://medium.com/media/3a375196baabc1e35b97edf0c8290c03/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*ld5LKGdp179YIV9pPZSExQ.jpeg" /></figure><h4>:optional</h4><p>Represents any &lt;input&gt;, &lt;select&gt;, or &lt;textarea&gt; element that does not have the required attribute set on it. Useful for styling fields that are not required to submit a form.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c5047109e667b36be6e4c2848bb65354/href">https://medium.com/media/c5047109e667b36be6e4c2848bb65354/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*qyjiZqLbwS60EM4kA1PIoA.jpeg" /></figure><h4>4.5) Tree-structural pseudo-classes</h4><p>These pseudo-classes relate to the location of an element within the document tree.</p><h4>:root</h4><p>Matches the root element of a tree representing the document. In HTML, :root represents the &lt;html&gt; element and is identical to the selector html, except that its specificity is higher.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/83a2f009d375a05a0480e77d5dfc2ca1/href">https://medium.com/media/83a2f009d375a05a0480e77d5dfc2ca1/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*SYoY884kZmmDgeovLir9jA.jpeg" /></figure><p>Global CSS variables are defined in the root selector.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/daecd66c612c0db133217f3432c96a96/href">https://medium.com/media/daecd66c612c0db133217f3432c96a96/href</a></iframe><h4>:empty</h4><p>Represents any element that has no children. Children can be either element nodes or text (including whitespace). Comments, processing instructions, and CSS content do not affect whether an element is considered empty.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7c18afc1074d2cdb175d0eb6f26d7f7a/href">https://medium.com/media/7c18afc1074d2cdb175d0eb6f26d7f7a/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*lYVVQ9TPRYOXMagtIOuq2g.jpeg" /></figure><h4>:nth-child</h4><p>Matches elements based on their position among a group of siblings. Uses <strong>A<em>n</em>+B</strong> notation to select elements.</p><p><strong>Element indices are 1-based.</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/835b29b5c6e2b1f42ead1024738f4186/href">https://medium.com/media/835b29b5c6e2b1f42ead1024738f4186/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IV-lgOh_xJJtzWDr5j59mg.jpeg" /></figure><p>— Other examples</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gIQWuUCj-zCMXkRwNgRHbw.jpeg" /></figure><h4>:nth-last-child</h4><p>Matches elements based on their position among a group of siblings, counting from the end.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2ad293ceda82e4f5f20011c64eb5adf3/href">https://medium.com/media/2ad293ceda82e4f5f20011c64eb5adf3/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6YSTkFi2jFlCgW1yhHoytw.jpeg" /></figure><p>— Other examples</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Za2OnEWww7mG-Jd_AI5xmg.jpeg" /></figure><h4>:first-child</h4><p>Represents the first element among a group of sibling elements.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/70a5f08249d88a8dc09f51ff46c0d361/href">https://medium.com/media/70a5f08249d88a8dc09f51ff46c0d361/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bS_9RCuJJPWf_S0su5W7vA.jpeg" /></figure><h4>:last-child</h4><p>Represents the last element among a group of sibling elements.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a81b306451c11ac51ab255051ff67d0d/href">https://medium.com/media/a81b306451c11ac51ab255051ff67d0d/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*D6snhGMjYsspiEC-Z9qDKg.jpeg" /></figure><h4>:only-child</h4><p>Represents an element without any siblings. This is the same as :first-child:last-child or :nth-child(1):nth-last-child(1), but with a lower specificity.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5c976134761531fbb9bc671432d63c6d/href">https://medium.com/media/5c976134761531fbb9bc671432d63c6d/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*bYY63ym2AyLotHHsJcnoIw.jpeg" /></figure><h4>:nth-of-type</h4><p>Uses <strong><em>An+B</em></strong> notation to select elements from a list of sibling elements that match a certain type from a list of sibling elements.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3648a162d47a1e88b038b4329d1456f5/href">https://medium.com/media/3648a162d47a1e88b038b4329d1456f5/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zVl7yqE2eXnv73dXQ1lsMg.jpeg" /></figure><h4>:nth-last-of-type</h4><p>Uses <strong><em>An+B</em></strong> notation to select elements from a list of sibling elements that match a certain type from a list of sibling elements counting backwards from the end of the list.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/275a552ca008652ef848c63a0dedc7c1/href">https://medium.com/media/275a552ca008652ef848c63a0dedc7c1/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bO772PCFF4QE9s2Rtc1kSQ.jpeg" /></figure><h4>:first-of-type</h4><p>Represents the first element of its type among a group of sibling elements.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7045c445ccbf158e7d064b6e7f2d10ca/href">https://medium.com/media/7045c445ccbf158e7d064b6e7f2d10ca/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*AOQNH-xfAfG8BpzSzJJUZw.jpeg" /></figure><h4>:last-of-type</h4><p>Represents the last element of its type among a group of sibling elements.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2a41142d53632d97919321560d9581e4/href">https://medium.com/media/2a41142d53632d97919321560d9581e4/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*NUyF0xI7NJjHnDHmrshaoA.jpeg" /></figure><h4>:only-of-type</h4><p>Represents an element that has no siblings of the same type.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a7441981eb96be024833bceee006786b/href">https://medium.com/media/a7441981eb96be024833bceee006786b/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*Qr6AT474K3hP9YaHL0wl3A.jpeg" /></figure><h4>4.6) Other psuedo-classes</h4><h4>:is()</h4><p>The function takes a selector list as its argument, and selects any element that can be selected by one of the selectors in that list. This is useful for writing large selectors in a more compact form.</p><blockquote>Note that older browsers support this functionality as :matches() or :any() , :any() works in exactly the same way as :matches() . Can be used to provide backwards compatibility.</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6e51acff8d86ae3589c9b14e0e5eb3c9/href">https://medium.com/media/6e51acff8d86ae3589c9b14e0e5eb3c9/href</a></iframe><p>Let’s select the &lt;h3&gt; element inside the &lt;div&gt;, &lt;main&gt; and &lt;article&gt; elements;</p><p>without use :is();</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/80df81d3588e6316178f7af620add42b/href">https://medium.com/media/80df81d3588e6316178f7af620add42b/href</a></iframe><p>its use with is();</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1db29b8a9b5f6380075675433ae182eb/href">https://medium.com/media/1db29b8a9b5f6380075675433ae182eb/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*gpNQEkmvNbQUX737azlu9w.jpeg" /></figure><p>Let’s try to style the &lt;h3&gt; and &lt;em&gt; elements inside the &lt;div&gt;, &lt;main&gt; and &lt;article&gt; elements.</p><p>without use :is();</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bf3b1e8e23f43d88c5ae9b7bed7faf27/href">https://medium.com/media/bf3b1e8e23f43d88c5ae9b7bed7faf27/href</a></iframe><p>its use with is();</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/194b0598f4155d79e822a46ba864c78c/href">https://medium.com/media/194b0598f4155d79e822a46ba864c78c/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*8ECbtDXILUVPU0NO_AfHzg.jpeg" /></figure><h4>:where()</h4><p>It does the same job as :is(), the difference is;</p><p>:where(): Always has 0 (zero) specificity.</p><p>:is(): has the specificity of the selector.</p><p>Let us examine the difference in the example below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/43dba487ba129c7c289038d33e5e945a/href">https://medium.com/media/43dba487ba129c7c289038d33e5e945a/href</a></iframe><p>As can be seen;</p><p>We couldn’t make the color of &lt;h3&gt; elements selected with :is() green. But we were able to change the color of the &lt;em&gt; elements selected with :where() to green.</p><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*QJxi_MyIynUnP7jsr5g8xQ.jpeg" /></figure><h4>:not()</h4><p>Represents elements that do not match a list of selectors.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bd6478b5a868c0f98fa4259700a56eb1/href">https://medium.com/media/bd6478b5a868c0f98fa4259700a56eb1/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5f8f31aa145f8d676401dbdc77ffde3d/href">https://medium.com/media/5f8f31aa145f8d676401dbdc77ffde3d/href</a></iframe><p>We can also select as follows, but selecting using commas is not supported enough by browsers.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/23189262542b5e6de0861627ef988bef/href">https://medium.com/media/23189262542b5e6de0861627ef988bef/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*JvyPdmopP1Kj7Scd-CYdjg.jpeg" /></figure><h4>:defined</h4><p>Represents any element that has been defined. This includes any standard element built in to the browser, and custom elements that have been defined.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bf8ddc63b78f9079811b8bd954f28cdd/href">https://medium.com/media/bf8ddc63b78f9079811b8bd954f28cdd/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*B78fw6_lQGybanqB_GoG0g.jpeg" /></figure><h4>:fullscreen</h4><p>Matches every element which is currently in fullscreen mode.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2bf28ac3e453674f244841d0a868856e/href">https://medium.com/media/2bf28ac3e453674f244841d0a868856e/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*LnfKpP3nlqvxk2EE-h3CCA.jpeg" /></figure><h4>:first</h4><p>Used with the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@page">@page</a> at-rule, represents the first page of a printed document.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dc27122fc0090714cb128a6456ec370f/href">https://medium.com/media/dc27122fc0090714cb128a6456ec370f/href</a></iframe><p>By giving the &lt;p&gt; elements a page-break-after: always attribute, we made each a separate page.</p><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*gksjjjUY86e91zxBiUtIpA.jpeg" /></figure><h4>:left</h4><p>Used with the @page at-rule, represents all left-hand pages of a printed document.</p><p>Whether a given page is “left” or “right” is determined by the major writing direction of the document. For example, if the first page has a major writing direction of left-to-right then it will be a :right page; if it has a major writing direction of right-to-left then it will be a :left page.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c70f52df1ca225d89899843af248a9e5/href">https://medium.com/media/c70f52df1ca225d89899843af248a9e5/href</a></iframe><p>If it is left-to-right (dir=&#39;ltr&#39;): left = 2. the sheet will be (Back) and leave a gap of 10 cm from the top when printing.</p><p>If it is right-to-left(dir=&#39;rtl&#39;): left = 1. the sheet will be (Front) and will leave a gap of 10 cm from the top when printing.</p><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*3iuOpsqCxqlOuMXkJMFuQw.jpeg" /></figure><h4>:right</h4><p>used with the @page at-rule, represents all right-hand pages of a printed document.</p><p>Whether a given page is “left” or “right” is determined by the major writing direction of the document. For example, if the first page has a major writing direction of left-to-right then it will be a :right page; if it has a major writing direction of right-to-left then it will be a :left page.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3963b2777f3a0d553da3f3a68b730a87/href">https://medium.com/media/3963b2777f3a0d553da3f3a68b730a87/href</a></iframe><p>If it is left-to-right dir=&#39;ltr&#39;: right = 1. the sheet will be (Front) and will leave a gap of 10 cm from the top when printing.</p><p>If it is right-to-left(dir=&#39;rtl&#39;): right = 2. the sheet will be (Back) and leave a gap of 10 cm from the top when printing.</p><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*cxFec9giCvG8BwCekZD7oA.jpeg" /></figure><p>For all the examples in this section, visit. See you in chapter-4.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2Fnioubk&amp;display_name=CodeSandbox&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2Fnioubk&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2Fnioubk%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/62945e32d9250ea10cfe9dd02b9e9826/href">https://medium.com/media/62945e32d9250ea10cfe9dd02b9e9826/href</a></iframe><p>We have come to the end of this chapter. See you in chapter-4.</p><p><strong><em>Chapter-4</em></strong></p><p><a href="https://medium.com/@ymzEmre/css-pseudo-elements-8f6048915432">CSS — Pseudo Elements</a></p><p><strong>Resource</strong></p><p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS">CSS: Cascading Style Sheets | MDN</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b6edcbc2d41" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CSS — Combinators & Grouping Selectors]]></title>
            <link>https://medium.com/@ymzEmre/css-combinators-grouping-selectors-843e4a823a72?source=rss-80a0453bc190------2</link>
            <guid isPermaLink="false">https://medium.com/p/843e4a823a72</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[css-selectors]]></category>
            <dc:creator><![CDATA[Emre Yilmaz]]></dc:creator>
            <pubDate>Sat, 19 Feb 2022 18:52:06 GMT</pubDate>
            <atom:updated>2022-04-22T21:25:46.234Z</atom:updated>
            <content:encoded><![CDATA[<h3>CSS — Combinators &amp; Grouping Selectors</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gZURNDJ2vjVxcOoUuZKswQ.png" /></figure><p>Hi everyone,</p><p>Welcome to c<em>hapter-</em>2 of a series of articles where I will tell you about all selectors in CSS.</p><p>I will tell you what are <strong>combinators</strong> and <strong>grouping selectors </strong>in this section.</p><h3>2) Combinators</h3><h4>Descendant combinator (whitespace)</h4><p>The descendant combinator — typically represented by a single space (“ “) character — combines two selectors such that elements matched by the second selector are selected if they have an ancestor (parent, parent’s parent, parent’s parent’s parent, etc) element matching the first selector. Selectors that utilize a descendant combinator are called descendant selectors.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c9bb1f074e85431c060860149e5d6dcf/href">https://medium.com/media/c9bb1f074e85431c060860149e5d6dcf/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*RgiDsYSdI_9_dwnrgpT_gA.jpeg" /></figure><h4>Child combinator (&gt;)</h4><p>The child combinator (&gt;) is placed between two CSS selectors. It matches only those elements matched by the second selector that are the direct children of elements matched by the first.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e1a809860bef1e7593c2867295163448/href">https://medium.com/media/e1a809860bef1e7593c2867295163448/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*zIq5d9P1E31vQ9aUbvS28Q.jpeg" /></figure><h4>General sibling combinator (~)</h4><p>The general sibling combinator (~) separates two selectors and matches all iterations of the second element, that are following the first element (though not necessarily immediately), and are children of the same parent element.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e04e7072d16bab99ccc106acc0bd18b4/href">https://medium.com/media/e04e7072d16bab99ccc106acc0bd18b4/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*zIq5d9P1E31vQ9aUbvS28Q.jpeg" /></figure><h4>Adjacent sibling combinator (+)</h4><p>The adjacent sibling combinator (+) separates two selectors and matches the second element only if it immediately follows the first element, and both are children of the same parent element.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7a50066b8372d36245036f5fbd3f0cee/href">https://medium.com/media/7a50066b8372d36245036f5fbd3f0cee/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*8G88otq8k3Y2NA2OiEV1_Q.jpeg" /></figure><h3>3) Grouping selectors</h3><h4>Selector list (,)</h4><p>Selects all the matching nodes.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7f21d12d200f3429d545e468147b34a7/href">https://medium.com/media/7f21d12d200f3429d545e468147b34a7/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*P0YMwousNscGIg2QmC3RTA.jpeg" /></figure><p>For all the examples in this section, visit.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2Fxkwd0o&amp;display_name=CodeSandbox&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2Fxkwd0o&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2Fxkwd0o%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/70f3845619a058c96627a3e055684de5/href">https://medium.com/media/70f3845619a058c96627a3e055684de5/href</a></iframe><p>We have come to the end of this chapter. See you in chapter-3.</p><p><strong><em>Chapter-3</em></strong></p><p><a href="https://medium.com/@ymzEmre/css-pseudo-classes-9b6edcbc2d41">CSS — Pseudo Classes</a></p><p><strong>Resources</strong></p><p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS">CSS: Cascading Style Sheets | MDN</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=843e4a823a72" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CSS — Cascade-Specificity-Basic selectors]]></title>
            <link>https://medium.com/@ymzEmre/css-cascade-specificity-basic-selectors-c5adc01dd861?source=rss-80a0453bc190------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5adc01dd861</guid>
            <category><![CDATA[css-selectors]]></category>
            <category><![CDATA[css-cascade]]></category>
            <category><![CDATA[css-specificity]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[Emre Yilmaz]]></dc:creator>
            <pubDate>Wed, 16 Feb 2022 21:35:48 GMT</pubDate>
            <atom:updated>2022-04-22T21:25:01.323Z</atom:updated>
            <content:encoded><![CDATA[<h3>CSS — Cascade, Specificity &amp; Basic selectors</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xhYbX3DF6psAk4WtcOxM1w.png" /></figure><p>Hi everyone,</p><p>Welcome to the series of articles where I will tell you about all the selectors in CSS. Let’s get started right away</p><p>I will tell you about <strong>cascade</strong>, <strong>specificity </strong>what are the <strong>basic selectors </strong>in this section.</p><h4>Cascade (Cascading Style Sheet)</h4><p>The cascading algorithm determines how to find the value to apply for each property for each document element.</p><p><strong>Cascading order</strong></p><p>Sorted in order of increasing specificity.</p><p><strong>1. Browser defaults styles</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*K1TESnpOVcxIztHA1bPvHg.jpeg" /></figure><p><strong>2. External styles</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*Pu8PtP08lLoYs_vy24Ncrg.png" /></figure><p><strong>3. Internal styles</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*EQAUNL79oxDxhlFAM9dktA.png" /></figure><p><strong>4. Inline styles</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*gk4v39f_gJ9r_2VdwUvnqw.png" /></figure><p><em>— Example</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/98c770532a8354ae8239420a361b0958/href">https://medium.com/media/98c770532a8354ae8239420a361b0958/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*9s0WKeuEGsfW3mX-_03WsQ.jpeg" /></figure><h4>Specificity</h4><p>Specificity is the means by which browsers decide which CSS property values are the most relevant to an element and, therefore, will be applied. When multiple declarations have equal specificity, the last declaration found in the CSS is applied to the element.</p><blockquote><strong>Note: </strong>Universal selector (*), combinators (+, &gt;, ~, “ “) and negation pseudo-class (:not()) have no effect on specificity. (The selectors declared inside :not() do, however.)</blockquote><blockquote><strong>Note:</strong> Proximity of elements in the document tree has no effect on the specificity.</blockquote><p><em>universal selector (*) = </em><strong><em>0,0,0 score</em></strong></p><p><em>type selectors and pseudo elements = </em><strong><em>0,0,1 score</em></strong></p><p><em>class selectors and pseudo classes = </em><strong><em>0,1,0 score</em></strong></p><p><em>ID selectors = </em><strong><em>1,0,0 score</em></strong></p><p><em>inline style = </em><strong><em>1,000 score</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hCcEXX_6xQyHmIIHsLkPDQ.png" /></figure><p>To calculate the specificity of selectors in CSS, you can visit. <a href="https://specificity.keegan.st/"><em>https://specificity.keegan.st</em></a></p><p><em>— Example</em></p><p>In the following example, let’s try to change the font color of the &lt;li&gt; tag.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3eb1defc32e3c682160f45481337260/href">https://medium.com/media/a3eb1defc32e3c682160f45481337260/href</a></iframe><p>Now let’s calculate the specificity values of the selectors.</p><ol><li><em>type =</em> <strong><em>0,0,1 </em>score</strong></li><li><em>type + class =</em> <strong><em>0, 1, 1 </em>score</strong></li><li><em>type + ID =</em> <strong><em>1, 0, 1 </em>score</strong></li><li><em>type + ID + class = </em><strong><em>1, 1, 1 </em>score</strong></li><li><em>type + ID + type + ID = </em><strong><em>2, 0, 2 </em>score</strong></li></ol><p>as can be seen, the more clearly the element to be selected is defined, the higher the specificity value.</p><p>As a result, the styles of the selector with<strong> <em>2, 0, 2</em> score</strong> will be applied (even if the code is at the top relative to the others during the line), and the &lt;li&gt; tag will be red.</p><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*ALCnN1qPpAxfu5eMa5pSjQ.jpeg" /></figure><p>If selectors score the same, CSS will apply the styles of the last selector in the line of code.</p><p><em>— Example</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*hBmEqMgTWuVby6W4DzxiKQ.png" /></figure><h4>1) Basic Selectors</h4><h4>Universal selector (*)</h4><p>Matches elements of any type.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/247488a2f7b1e9096338b26b8fc4febd/href">https://medium.com/media/247488a2f7b1e9096338b26b8fc4febd/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*4aiZ9P6AaNZWewf1vGJDmA.jpeg" /></figure><h4>Type selector</h4><p>Matches elements by node name. In other words, it selects all elements of the given <strong>type</strong> within a document.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c55310d607b595503e31f2b048a66b4b/href">https://medium.com/media/c55310d607b595503e31f2b048a66b4b/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*zexnylpZLkjan3LJ0WCSYA.jpeg" /></figure><h4>Class selectors (.)</h4><p>Matches elements based on the contents of their class attribute.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cd7b6f3e72b4105ad366e7bd4771eb8b/href">https://medium.com/media/cd7b6f3e72b4105ad366e7bd4771eb8b/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*tRQvYKkOa7d86iUwvCAfYQ.jpeg" /></figure><h4>ID selectors (#)</h4><p>Matches an element based on the value of the element’s id attribute. In order for the element to be selected, its id attribute must match exactly the value given in the selector.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f7b843d12e99eeaf308aa5c286d54eb9/href">https://medium.com/media/f7b843d12e99eeaf308aa5c286d54eb9/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*tRQvYKkOa7d86iUwvCAfYQ.jpeg" /></figure><h4>Attribute selectors</h4><p><strong><em>[attr]</em></strong><br>Matches elements with an attribute name of <em>attr</em>.</p><p><em>— Example</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f9a7e9db516219b8a7e00ffbd585c6b4/href">https://medium.com/media/f9a7e9db516219b8a7e00ffbd585c6b4/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*xWrg36ElOweTKd5irOqZUg.jpeg" /></figure><p><strong><em>[attr=value]</em></strong><br> Matches elements with an attribute name of <em>attr </em>whose value is exactly value.</p><p><em>— Example</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/582353d6f605c2b92932bff5e4fa1d7b/href">https://medium.com/media/582353d6f605c2b92932bff5e4fa1d7b/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*tAKyk7lW-ptUn4J7DX8g9A.jpeg" /></figure><p><strong><em>[attr~=value]</em></strong><br>Matches elements with an attribute name of <em>attr </em>whose value is a whitespace-separated list of words, one of which is exactly value.</p><p><em>— Example</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c72c3bdf5bbf0552afc216c997a492e9/href">https://medium.com/media/c72c3bdf5bbf0552afc216c997a492e9/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*NXLItElmTMdACpUK88gv6w.jpeg" /></figure><p><strong><em>[attr|=value]</em></strong><br>Matches elements with an attribute name of <em>attr </em>whose value can be exactly value or can begin with value immediately followed by a hyphen.</p><p><em>— Example</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ff8f2bb471213d7db9954f3584ffd279/href">https://medium.com/media/ff8f2bb471213d7db9954f3584ffd279/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*NXLItElmTMdACpUK88gv6w.jpeg" /></figure><p><strong><em>[attr^=value]</em></strong><br>Matches elements with an attribute name of <em>attr </em>whose value is prefixed (preceded) by value.</p><p><em>— Example</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/686c3d010ce9bbc99a3e096861ee6134/href">https://medium.com/media/686c3d010ce9bbc99a3e096861ee6134/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*RgiDsYSdI_9_dwnrgpT_gA.jpeg" /></figure><p><strong><em>[attr$=value]</em></strong><br>Matches elements with an attribute name of <em>attr </em>whose value is suffixed (followed) by value.</p><p><em>— Example</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/059fd1141a3a1ff99ef3fe19347e4c1c/href">https://medium.com/media/059fd1141a3a1ff99ef3fe19347e4c1c/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*RgiDsYSdI_9_dwnrgpT_gA.jpeg" /></figure><p><strong><em>[attr*=value]</em></strong><br>Matches elements with an attribute name of <em>attr </em>whose value contains at least one occurrence of value within the string.</p><p><em>— Example</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7b3a4ce8a6c5074f3291e50b455a4077/href">https://medium.com/media/7b3a4ce8a6c5074f3291e50b455a4077/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*RgiDsYSdI_9_dwnrgpT_gA.jpeg" /></figure><p><strong><em>[attr operator value i]</em></strong><br>Adding an i or I before the closing bracket causes the value to be compared case-insensitively.</p><p><em>— Example</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1b08d209ffbe38f1ccfec313625f126e/href">https://medium.com/media/1b08d209ffbe38f1ccfec313625f126e/href</a></iframe><p><em>— Output</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*l98tQ4x7X9E3uA_Jt5gPsQ.jpeg" /></figure><p>For all the examples in this section, visit.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2Fydwpip&amp;display_name=CodeSandbox&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2Fydwpip&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2Fydwpip%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/e5a3cbbb1226af87bfbe489eb8b18869/href">https://medium.com/media/e5a3cbbb1226af87bfbe489eb8b18869/href</a></iframe><p>We have come to the end of this chapter. See you in chapter-2.</p><p><strong><em>Chapter-2</em></strong></p><p><a href="https://medium.com/@ymzEmre/css-combinators-grouping-selectors-843e4a823a72">CSS — Combinators &amp; Grouping Selectors</a></p><p><strong>Resources</strong></p><ul><li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS">CSS: Cascading Style Sheets | MDN</a></li><li><a href="https://stuffandnonsense.co.uk/archives/css_specificity_wars.html">CSS Specificity Wars</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5adc01dd861" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>