<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Oluwaseyi Idowu</title>
    <description>The latest articles on DEV Community by Oluwaseyi Idowu (@idowuseyi).</description>
    <link>https://dev.to/idowuseyi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1110042%2F52a40d5c-7494-4971-91b8-568cbf4f9c16.jpeg</url>
      <title>DEV Community: Oluwaseyi Idowu</title>
      <link>https://dev.to/idowuseyi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/idowuseyi"/>
    <language>en</language>
    <item>
      <title>System Design: The Art of Balancing Trade-Offs</title>
      <dc:creator>Oluwaseyi Idowu</dc:creator>
      <pubDate>Sat, 04 Jan 2025 15:33:54 +0000</pubDate>
      <link>https://dev.to/idowuseyi/system-design-the-art-of-balancing-trade-offs-53j9</link>
      <guid>https://dev.to/idowuseyi/system-design-the-art-of-balancing-trade-offs-53j9</guid>
      <description>&lt;p&gt;Few days ago, I took a deep dive into system design—a discipline that has since reshaped how I think about building scalable, efficient, and resilient systems.&lt;br&gt;
At its core, system design involves envisioning the complete lifecycle of a system, identifying potential bottlenecks, and planning for scalability from the outset. Whether you're transitioning from a static application to a dynamic one, or building a system to handle millions—or even billions—of users, the ability to anticipate and design for future challenges is crucial. This is where system design comes in, helping us put things into perspective and make informed decisions that ensure the system evolves seamlessly as demands grow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why System Design Matters
&lt;/h2&gt;

&lt;p&gt;System design isn't just about the architecture or technology stack—it's about making deliberate choices that align with the system's functionality, stage of growth, and optimization needs. It helps answer pivotal questions such as:&lt;br&gt;
    • When should we introduce a web server or load balancer?&lt;br&gt;
    • At what point do we scale our database vertically or horizontally, and should we consider replicas or a master-slave configuration?&lt;br&gt;
    • Do we need caching mechanisms for faster data access?&lt;br&gt;
    • Should we leverage a CDN for content delivery or shared storage for stateful and stateless architecture?&lt;br&gt;
    • How do we implement data centers, message queues, sharding, logging, metrics, and automation to ensure scalability and resilience?&lt;br&gt;
Each of these decisions requires a solid understanding of the system's requirements and potential trade-offs. A poorly designed system can lead to bottlenecks, inefficiencies, and even complete failure at scale.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Role of Back-of-the-Envelope Estimation
&lt;/h2&gt;

&lt;p&gt;As developers and team members, understanding the trade-offs involved in building profitable, scalable systems is a core responsibility. This is why many organizations encourage back-of-the-envelope estimations—a practice of estimating a system's capacity or performance based on given requirements.&lt;br&gt;
As Jeff Dean, a Senior Fellow at Google, once explained, &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Back-of-the-envelope calculations are estimates you create using a combination of thought experiments and common performance numbers to get a good feel for which designs will meet your requirements."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This practice is essential for making educated guesses about factors like:&lt;br&gt;
    • Query per second (QPS) capacity&lt;br&gt;
    • Storage requirements&lt;br&gt;
    • Latency expectations&lt;br&gt;
It requires a strong sense of scalability, optimization, and practical understanding of trade-offs&lt;/p&gt;

&lt;h2&gt;
  
  
  Trade-Offs: The Heart of System Design
&lt;/h2&gt;

&lt;p&gt;Every system design decision involves trade-offs. A well-designed system balances factors like security, availability, scalability, consistency, latency, and more. Understanding these trade-offs is what makes system design both challenging and fascinating.&lt;br&gt;
One simplified example of these trade-offs is &lt;strong&gt;the CAP theorem&lt;/strong&gt;, which states that it is impossible for a distributed system to simultaneously guarantee more than two of the following three properties:&lt;br&gt;
    • Consistency (every read receives the most recent write)&lt;br&gt;
    • Availability (every request receives a response, even if it’s not the latest)&lt;br&gt;
    • Partition tolerance (the system continues to operate despite network partitions).&lt;br&gt;
This theorem forms the basis of many system design decisions. For instance, in high-scale systems like those for e-commerce or social media, one might prioritize availability and partition tolerance over strict consistency to ensure a seamless user experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building for the Future
&lt;/h2&gt;

&lt;p&gt;System design isn’t just a skill for programmers—it’s a shared responsibility for everyone involved in creating scalable, secure, and user-friendly solutions. From engineers to product managers, understanding system design equips teams to make better decisions and create systems that stand the test of time.&lt;br&gt;
A well-designed system reflects a thoughtful balance of trade-offs, driven by the business’s goals and the system's users. It anticipates the challenges of scaling and provides solutions that not only meet immediate needs but also future-proof the system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let’s Talk System Design
&lt;/h2&gt;

&lt;p&gt;For me, the journey into system design has been an eye-opening experience, teaching me the importance of balancing competing priorities in building solutions that work for both users and businesses.&lt;br&gt;
What about you? Which trade-offs or bottlenecks fascinate you most in system design? Are there particular concepts you find intriguing or challenging? I’d love to hear your thoughts—let’s discuss in the comments!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>softwareengineering</category>
      <category>systemdesign</category>
      <category>programming</category>
    </item>
    <item>
      <title>UNDERSTANDING API LIKE A PRO</title>
      <dc:creator>Oluwaseyi Idowu</dc:creator>
      <pubDate>Sat, 26 Aug 2023 22:20:19 +0000</pubDate>
      <link>https://dev.to/idowuseyi/understanding-api-like-a-pro-5cfo</link>
      <guid>https://dev.to/idowuseyi/understanding-api-like-a-pro-5cfo</guid>
      <description>&lt;h1&gt;
  
  
  APPLICATION PROGRAMMING INTERFACES - (API)
&lt;/h1&gt;

&lt;h2&gt;
  
  
  BACKGROUND INFORMATION ABOUT API
&lt;/h2&gt;

&lt;p&gt;In your small dev journey, it is almost impossible you wouldn't have come across this term somewhere somehow. It crops up so often. So, what are API and what can we do with it. In this article, we would be interacting with some API, and we would use one of them to understand API like in details.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;APIs&lt;/strong&gt; are very useful. For example, Email collector API is very useful if you're building a landing page or a newsletter, preorder, etc. Before this we must understand what are API and what are they useful for.&lt;/p&gt;

&lt;p&gt;If you go to yahoo.com, on this page you would notice a section that display the weather parameters of your current location.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Z6AP4_-F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3bb6k4b1hvjfpu125cr1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Z6AP4_-F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3bb6k4b1hvjfpu125cr1.png" alt="Illustration of explained points above" width="800" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we want to create our own website and we want a module like this, how do we go about this? Notice we wouldn't be able to set up a weather station, take measurement and then integrate this on our site. The problem is that we can't even set up a weather station in all locations of the world.&lt;/p&gt;

&lt;p&gt;So where do we get the weather from anyway? We will use weather system interface like weather API.&lt;br&gt;
(&lt;a href="https://openweathermap.org/api"&gt;https://openweathermap.org/api&lt;/a&gt;)&lt;br&gt;
Weather API have collected all these pieces of weather data, do the forecast and all complex stuff, so all we have to do is to use their API to tap into that weather data just like yahoo do it on their page. In the same way too, when you go to tinder [&lt;a href="https://tinder.com/"&gt;https://tinder.com/&lt;/a&gt;] and you see their share friends and shared interest section. Where are these data coming from, its coming from Facebook using the Facebook API. They use those data to populate that section of their site.&lt;/p&gt;

&lt;p&gt;Over the internet, we have tones of API that we can use for anything we want to do. In the UK we have police API, that provide data on crimes and other data and people have used it to build interesting stuff. One of this is murdermap. This platform uses the police API to map out murder crimes and classify these crimes based on different metrics especially for London using the data supplied by the API. Someone can use this information to decide where to live and where to avoid.&lt;/p&gt;

&lt;p&gt;There are API's that provide prices, and several other stuffs and you can use this data to build anything you want.&lt;/p&gt;

&lt;h2&gt;
  
  
  WHAT IS API – APPLICATION PROGRAMMING INTERFACES - DEFINED
&lt;/h2&gt;

&lt;p&gt;According to general accepted definition, an API is a set of commands, functions, protocols, and objects that programmers can use to create software or interact with an external system.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Does This Means?
&lt;/h3&gt;

&lt;p&gt;Let say you go to a restaurant; they will surely have their menu accessible to you but at the same time you can go into the kitchen where we have the ingredients and recipe and probably some surprised chefs. If you go into the kitchen and start eating this raw recipe and ingredients, certainly the restaurant authorities won’t be happy about it. This means that, though there were things they sell that they will allow you to buy but there are other things that are off limit. The same way for websites that takes and have their own data, be it Facebook which has data on users or police API which has data on crimes. There are data they would allow you to access but there are others that they would never want you to see. It is none of your business. So how do these websites tell you what data you can access and how you can access them. If we take the case of a restaurant, they will do it i.e tell you what is available in a menu. The content in the menu may be cakes, cookies, coffee, etc. This is the same for websites. Like OpenWeatherMap, we can have temperature, weather condition, weather image/icon, pressure etc. An API, some people consider to be a contract between a data provider and a developer which says these are data that a data provider provides, the one a developer can use and the ways, protocols and how to use those data and that the website that host this data would not change any of this agreement without a proper notification.&lt;/p&gt;

&lt;p&gt;Our definition of an API can now make sense, a set of data programmers/developers can use to create or interact with an external system.&lt;/p&gt;

&lt;p&gt;We have seen the ones that allows you to interact with an external system, but we haven't seen any that allow you to create a software. Or have we?&lt;/p&gt;

&lt;p&gt;Yes, we have, remember jQuery? (If you want to understand and use jQuery like a pro, kindly contact us or reach out in a mail). It is a tool that gives you access to object and methods that allows you create software easily other than writing vanilla JavaScript to manipulate the DOM.&lt;/p&gt;

&lt;p&gt;Let’s take a look at Tindall, on Tindall, Facebook API is used to interact with an external system when you're on their website.&lt;/p&gt;

&lt;p&gt;In this article we are going to focus on API that allows you to interact with an external system most importantly an external server. We are going to access some data from some website and we will do that through their API. We will read their documentation to see what we can do with them. We will make requests to their server and get responses all through their API. Their documentation will serve as a menu/guide for what we can do with their data.&lt;/p&gt;

&lt;h2&gt;
  
  
  API ENDPOINTS, PATHS AND PARAMETERS
&lt;/h2&gt;

&lt;p&gt;In the last few words, we have learnt about API all in the theory. In this section we will be going practical. We will access and use APIs from some website.&lt;/p&gt;

&lt;p&gt;When you think about an API you need to be thinking about things like Endpoints, Paths, Parameters and Authentication. These are the four things we will cover and we will see what each of this do.&lt;/p&gt;

&lt;h3&gt;
  
  
  API ENDPOINTS
&lt;/h3&gt;

&lt;p&gt;Every API that interacts with an external system will surely have endpoints.&lt;/p&gt;

&lt;p&gt;Let's quickly look at kanyewest API at kanye.rest for random Kanye West quotes. This data is hosted on kanye west database and one of its endpoints is&lt;br&gt;
GET [&lt;a href="https://api.kanye.rest"&gt;https://api.kanye.rest&lt;/a&gt;]&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wJ5khpe5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9r5bui9gj1fl525tqv97.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wJ5khpe5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9r5bui9gj1fl525tqv97.png" alt="Illustration of explained points above" width="800" height="767"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Whenever you are using a different API, they would probably have their own endpoints and the details of this will be included in their documentation. Most of the time each use case or functionalities of an API will have an endpoint. If we copy the link above – (endpoint) and paste it in our browser our browser will make a request to the kanye.rest server and that server will send back a response which is a quote by Kanye West.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YFIr2M4Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ed3uz58js0bv516fjr5l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YFIr2M4Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ed3uz58js0bv516fjr5l.png" alt="Illustration of explained points above" width="800" height="145"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's say we create a website and every day you come to the website; you get a Kanye quote. We can probably do that using this API.&lt;/p&gt;

&lt;p&gt;Note: To have the look above, you need to install JSON viewer Pro chrome extension and use it. It helps to view server responses in a more human friendly format. It also has other great options and benefits like finding a specific path and copying of paths. It also has other great functionalities that you might want to try out.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ixfZ4CTW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4obgq2xvc1jilcx8sefj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ixfZ4CTW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4obgq2xvc1jilcx8sefj.png" alt="Illustration of explained points above" width="800" height="189"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is important to say that most websites that have API has more data than just a random quote.&lt;/p&gt;

&lt;p&gt;In addition to an endpoint, there is also API paths and parameters.&lt;/p&gt;

&lt;h3&gt;
  
  
  API PATHS AND PARAMETERS
&lt;/h3&gt;

&lt;p&gt;These are things that you can use to narrow down on a specific piece of data from an external server. To illustrate this, we will use an API from a joke website.&lt;/p&gt;

&lt;p&gt;[&lt;a href="https://sv443.net/jokeapi/v2/"&gt;https://sv443.net/jokeapi/v2/&lt;/a&gt;]&lt;/p&gt;

&lt;p&gt;or [&lt;a href="https://v2.jokeapi.dev/"&gt;https://v2.jokeapi.dev/&lt;/a&gt;]&lt;/p&gt;

&lt;p&gt;Through the use of paths and parameters we can narrow down on the kind of jokes we want from this website or server.&lt;/p&gt;

&lt;p&gt;Use any of the links above to get to the jokeAPI platform.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OeH96coI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f467hawi133lb858il8a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OeH96coI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f467hawi133lb858il8a.png" alt="Illustration of explained points above" width="800" height="527"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This joke API is more complex than the Kanye West one because it has more option for you as the programmer. You can select the kind of joke you want based on category, flags to blacklist, response format, joke type, included string and others. See it below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fo0sk78f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w6ahh3jz7p46hok8ul2v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fo0sk78f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w6ahh3jz7p46hok8ul2v.png" alt="Illustration of explained points above" width="800" height="527"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first thing we need to do to use this API is to get the starting point which is the endpoint. If you go to the link above and you scroll down, you will see a bunch of endpoints. You will see one that says GET joke.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WthmzUAf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zo58fmnuok00te5r03z2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WthmzUAf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zo58fmnuok00te5r03z2.png" alt="Illustration of explained points above" width="800" height="275"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we just copy the URL above and paste it in our browser, you will see that you get an error that says - no matching joke found, no category selected.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HQw5y1mC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s66zxhnexr281gramkvj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HQw5y1mC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s66zxhnexr281gramkvj.png" alt="Illustration of explained points above" width="800" height="490"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, what is going on here? Although we have the endpoint but there is something missing which is the category. If we use the try it out section,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--py5esI9v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d5v2tbrug1tm6r08kbeg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--py5esI9v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d5v2tbrug1tm6r08kbeg.png" alt="Illustration of explained points above" width="800" height="527"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;you will see we have a category call any and it is set to category ‘any’ and if you select programming it changes the URL at the bottom to /programming at the end.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S2RrNbsA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iz7bwlw1gnknigxgf83n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S2RrNbsA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iz7bwlw1gnknigxgf83n.png" alt="Illustration of explained points above" width="800" height="531"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, the difference here is that we need to select a specific path after the endpoint. If the endpoint is the main tree, the path is the branch.&lt;/p&gt;

&lt;p&gt;Here we have seen a path specified here. The endpoint is the main API link and the category is the path e.g programming or dark or any or other ones provided by this jokeAPI.&lt;/p&gt;

&lt;p&gt;Remember when we are working with express and building up a server, when we are creating a new path/route we need to plan for it so that when a request is made to our server, we need to be able to catch and filter through to get the specific parameter we want and want to use.&lt;/p&gt;

&lt;p&gt;Sometimes we might want to get a piece of data that is specific say a programming joke that contains the word debugging but the API developer won’t probably have thought of this beforehand so in order to allow the API to respond to things like this, we use what we called parameters. These parameters can be attached to the end of the URL after a question mark. It is sometimes a key value pair e.g., /?contain=debugging. The key might contain a string and the query is the debugging which is the value.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yaB9VyAJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8aa06uz6f3wjvlobg1qy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yaB9VyAJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8aa06uz6f3wjvlobg1qy.png" alt="Illustration of explained points above" width="800" height="513"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is what is tried out. Other things are added to the link as we select some options in this section. The more we change the default selections, the more the parameters that are added to the link. Now notice if we have more than one query, the first query follows after the question mark, and the subsequent queries follows after the &amp;amp; symbol.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--N5mZ41F8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fwxuedozi5spa8fmwdzr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N5mZ41F8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fwxuedozi5spa8fmwdzr.png" alt="Illustration of explained points above" width="800" height="535"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you want to specify a parameter, remember that you need these symbols to use them, it comes after a question mark (?), then the key, then followed by an equal to (=) sign, then followed by a search string. Any other parameter or key value pair which is an additional query will come after the and (&amp;amp;) sign.&lt;/p&gt;

&lt;p&gt;If we use this link in our browser, we will get a joke with the options we have specified.&lt;/p&gt;

&lt;p&gt;[&lt;a href="https://v2.jokeapi.dev/joke/Programming?blacklistFlags=sexist&amp;amp;type=single&amp;amp;contains=debugging"&gt;https://v2.jokeapi.dev/joke/Programming?blacklistFlags=sexist&amp;amp;type=single&amp;amp;contains=debugging&lt;/a&gt;]&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FhNIWT0M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8haa3xe5ju7ca8agxh6z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FhNIWT0M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8haa3xe5ju7ca8agxh6z.png" alt="Image description" width="800" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note: You can select plain text under the response format to add that parameter and your responses would be in plain text.&lt;/p&gt;

&lt;p&gt;Now with the addition of a parameter, we are able to get something specific and a precise thing that we want.&lt;/p&gt;

&lt;p&gt;Now, you have seen an API in action, how to use an endpoint, also how to identify and use path and parameters to narrowed down on a piece of data.&lt;/p&gt;

&lt;p&gt;You can stop reading for now. Take some time and play with this API adding some path and parameter in your browser and making some requests and getting responses. Ensure you know what is going on when you type out those long URLs in your browser.&lt;/p&gt;

&lt;p&gt;In the next article we will talk about authentication and what we will have in our responses.&lt;/p&gt;

&lt;p&gt;Don’t forget to drop your comments, suggestions and any questions you might have.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>api</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>CSS Selectors, Combination And Avoiding Conflicting Styling; (CSS Selector Mastery and Best practices).</title>
      <dc:creator>Oluwaseyi Idowu</dc:creator>
      <pubDate>Thu, 24 Aug 2023 14:04:33 +0000</pubDate>
      <link>https://dev.to/idowuseyi/css-selectors-combination-and-avoiding-conflicting-styling-css-selector-mastery-and-best-practices-3mg4</link>
      <guid>https://dev.to/idowuseyi/css-selectors-combination-and-avoiding-conflicting-styling-css-selector-mastery-and-best-practices-3mg4</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cascading Style Sheet (CSS)&lt;/strong&gt; has stood out as the ultimate tool for styling a webpage. While the HTML helps in structuring and outlining our webpage, the CSS is used to colour, design and style our webpage. Let's say our webpage or website is a building, the HTML will be the block which are layered to give the shape of the building. The CSS will be the painting, styling and decoration of our building. It is also good to state where JavaScript stands in all of this. Ultimately, JavaScript is used in maintaining or giving functionality to the elements in our webpage. A simple colour combination implemented with CSS can make a lot of difference in a web page or site. Though there are many things to learn about CSS styling in this article, you will learn about CSS selectors and how to avoid conflicting styling in your web projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Content
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;What are CSS selectors&lt;br&gt;
i. What is CSS&lt;br&gt;
ii. What are selectors&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What are the uses of different CSS selectors&lt;br&gt;
i. What are the different CSS selectors available&lt;br&gt;
ii. What are the specific uses of CSS selectors&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Examples of different CSS selectors and their uniqueness.&lt;br&gt;
i. Examples of different CSS selectors&lt;br&gt;
ii. What are the uniqueness of each CSS selector&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Combination of different CSS selectors with examples&lt;br&gt;
i. Pick &amp;amp; Mix Selectors&lt;br&gt;
a. Multiple selectors&lt;br&gt;
b. Hierarchical Selectors&lt;br&gt;
c. Combined Selectors&lt;br&gt;
ii. What is the difference between the one with space and one without space. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How to avoid conflicting styling in our web design&lt;br&gt;
i. Understanding conflicting styling in web design&lt;br&gt;
ii. What are the major causes of conflicting styling&lt;br&gt;
iii. Ways and How to avoid conflict styling&lt;br&gt;
iv. Principles and best practices in good CSS styling&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;To get the most out of this guide, it is expected that you should have a basic understanding of HTML, CSS and or JavaScript. If you are not familiar with these technologies, we recommend that you take some few minutes checking them out to familiarise yourself with them before you proceed with this guide.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  1. What are CSS selectors
&lt;/h3&gt;

&lt;p&gt;Before we look at CSS selectors, it is important to understand CSS itself. So we will quickly look at the following to properly understand CSS and CSS selectors.&lt;/p&gt;

&lt;h4&gt;
  
  
  i. What is CSS:
&lt;/h4&gt;

&lt;p&gt;According to the several sources including official documentation, tutorials and books, Cascading Style Sheet (CSS) can be defined as a style language used to describe the presentation and formatting of a document written in a markup language such as HyperText Markup Language (HTML) or XML. It allows developers and web designers to control the layout, design and appearance of web pages, making it easier to separate content from presentation. For example,if our web page is a building, the markup language HTML will be used for the layed blocks or structure of the building while our CSS will be used for the painting, designing and decorating of our building.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
    &amp;lt;html lang="en"&amp;gt;
    &amp;lt;head&amp;gt;
      &amp;lt;meta charset="UTF-8"&amp;gt;
      &amp;lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&amp;gt;
      &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
      &amp;lt;title&amp;gt;Document&amp;lt;/title&amp;gt;
    &amp;lt;/head&amp;gt;
    &amp;lt;body&amp;gt;
      &amp;lt;h1&amp;gt;Hello World!&amp;lt;/h1&amp;gt;
    &amp;lt;/body&amp;gt;
    &amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Note: You can generate the above by pressing control button + exclamation mark in vs code.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If we put the above in a filename.html file and open it with any browser, A white page with a black Hello World text is displayed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fstjc9pl5pm3uh0x0uaie.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fstjc9pl5pm3uh0x0uaie.jpg" alt="Code on the editor &amp;amp; or its Output"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let say we want the colour of the text to be red, this is where CSS comes in.&lt;/p&gt;

&lt;p&gt;We can include some style in the markup above by doing the below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
    &amp;lt;html lang="en"&amp;gt;
      &amp;lt;head&amp;gt;
        &amp;lt;meta charset="UTF-8"&amp;gt;
        &amp;lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&amp;gt;
        &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
        &amp;lt;title&amp;gt;Document&amp;lt;/title&amp;gt;
      &amp;lt;/head&amp;gt;
      &amp;lt;body&amp;gt;
        &amp;lt;h1 style="color: red;"&amp;gt;Hello World!&amp;lt;/h1&amp;gt;
      &amp;lt;/body&amp;gt;
    &amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0jih8n9lyv8ol6vivmfo.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0jih8n9lyv8ol6vivmfo.jpg" alt="Code on the editor &amp;amp; or its Output"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note the difference!&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  ii. What are selectors:
&lt;/h4&gt;

&lt;p&gt;Selectors can be referred to as markers or reference names with which we can style our HTML elements. In writing a good CSS, it is always good to keep all our CSS and styling files in a separate file. This is good practice. Most of the time, software engineers or developers name this file styles.css. So instead of including our CSS styling in our HTML we will keep it in a separate file. Atimes, some put it in  a separate folder entirely. Create a new file named style.css in the same folder where we have the html file. All our css styling will be written in this CSS file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbwan71kzjlgsx59skv5p.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbwan71kzjlgsx59skv5p.jpg" alt="Code on the editor &amp;amp; or its Output"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To style our h1 heading above, first we need to remove the inline styling in the h1 above, so that our style can reflect.&lt;/p&gt;

&lt;p&gt;Now in our CSS file we can use a selector to select our h1 and then write our style. See the sample below.&lt;br&gt;
In our CSS file, write or paste the styling below;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;h1 {
        color: red;
      }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This changes the colour of our h1 just as we have it when we write it within the h1 tag in our html file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd9sxmm2xqxsosnayknc8.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd9sxmm2xqxsosnayknc8.jpg" alt="Code on the editor &amp;amp; or its Output"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is what we call an external CSS and for it to work we have to connect it to our html file by including the below within the head of our html file.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  `&amp;lt;link rel="stylesheet" href="style.css"&amp;gt;`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fschasws6mxkz61sgwspd.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fschasws6mxkz61sgwspd.jpg" alt="Code on the editor &amp;amp; or its Output"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the example above, h1 is a selector. &lt;/p&gt;

&lt;h3&gt;
  
  
  2. What are the uses of different CSS selectors
&lt;/h3&gt;

&lt;p&gt;As we have seen above, selector is simply a reference with which we can use to apply styles on our HTML elements. They are used as references through which we can apply a distinct or unique styling to any HTML elements.&lt;/p&gt;

&lt;h4&gt;
  
  
  i. What are the different CSS selectors available:
&lt;/h4&gt;

&lt;p&gt;Imagine if we only have one selector and we have multiple h1 in our HTML document. Applying a different style to each of them would have been impossible because if the browser sees a different style for a single element, the last one is retained.&lt;br&gt;
    Take a look;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
    &amp;lt;html lang="en"&amp;gt;
      &amp;lt;head&amp;gt;
        &amp;lt;meta charset="UTF-8"&amp;gt;
        &amp;lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&amp;gt;
        &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
        &amp;lt;link rel="stylesheet" href="style.css"&amp;gt;
        &amp;lt;title&amp;gt;My page&amp;lt;/title&amp;gt;
      &amp;lt;/head&amp;gt;
      &amp;lt;body&amp;gt;
        &amp;lt;h1&amp;gt;Welcome to my site&amp;lt;/h1&amp;gt;
        &amp;lt;h3&amp;gt;First Selector&amp;lt;/h3&amp;gt;
        &amp;lt;p&amp;gt;This is a paragraph tag. We can include many sentences within here.&amp;lt;/p&amp;gt;
        &amp;lt;h3&amp;gt;Second Selector&amp;lt;/h3&amp;gt;
        &amp;lt;p&amp;gt;HTML is for layout. It is for inputting and arranging our document in our webpage&amp;lt;/p&amp;gt;
      &amp;lt;/body&amp;gt;
    &amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In our style.css, Let say we want to apply different bacground-color to the h3&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;h3 {
        background-color: black;
      }

      h3 {
        background-color: brown;
      }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjaet5q3us32hivec7q3s.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjaet5q3us32hivec7q3s.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The background-color that we will see for both h3 will be brown. This is because the h3 tag selects all the h3 elements in our HTML. So what is the way out?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important point to note:&lt;/strong&gt;&lt;br&gt;
      &lt;em&gt;In styling application on html markup with CSS, If there are two styles on the same element or html tag, the last styling is what is applied. This is well proven by what we have above. We have two different styles on the h3 but the style further down the line of code is what is applied. This is one of the most important rules to have in mind why using CSS.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;There are other CSS selectors we can use. This includes;&lt;br&gt;
        a. HTML tagname&lt;br&gt;
        b. class&lt;br&gt;
        c. id&lt;/p&gt;
&lt;h4&gt;
  
  
  ii. What are the specific uses of CSS selectors
&lt;/h4&gt;

&lt;p&gt;As we know all CSS selectors can be used to apply style to our HTML elements. With the different selectors above, each HTML element or content on our webpage or a group of content on our web page can have a unique style applied to them separately or as a group.&lt;/p&gt;
&lt;h3&gt;
  
  
  3. Examples of different CSS selectors and their uniqueness
&lt;/h3&gt;

&lt;p&gt;You might be wondering, what are the differences between all these CSS selectors? Each of these selectors although have a lot of similarities but they also have their uniqueness.&lt;/p&gt;
&lt;h4&gt;
  
  
  i. Examples of different CSS selectors
&lt;/h4&gt;

&lt;p&gt;Take a look at this.&lt;br&gt;
Lets edit our body in the HTML above to the one below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;body&amp;gt;
        &amp;lt;section id="section1"&amp;gt;
          &amp;lt;h1 class="header1 brown"&amp;gt;Welcome to my site&amp;lt;/h1&amp;gt;
          &amp;lt;h3 class="blue"&amp;gt;First Selector&amp;lt;/h3&amp;gt;
        &amp;lt;p class="brown"&amp;gt;This is a paragraph tag. We can include many sentences within here.&amp;lt;/p&amp;gt;
          &amp;lt;h3 class="brown"&amp;gt;Second Selector&amp;lt;/h3&amp;gt;
          &amp;lt;p class="blue"&amp;gt;HTML is for layout. It is for inputting and arranging our document in our webpage&amp;lt;/p&amp;gt;
        &amp;lt;/section&amp;gt;
      &amp;lt;/body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then in our style.css, let's include the following styles&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;body {
        background-color: #8f8f8f;
      }

      #section {
        font-family: sans-serif;
      }

      .header1 {
        font-size: 3.5rem;
        line-height: 1.5;
        font-weight: 900;
        color: #fff;
      }

      h3 {
        font-size: 2.5rem;
        }

      .blue {
        color: blue;
      }

      .brown {
        color: brown;
      }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can try to predict how the page will look like. Check it below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffvjew1ne9811qy6trekf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffvjew1ne9811qy6trekf.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are many things to note about our output as displayed here. The body and h3 are HTML tag selectors. header1, blue, brown are all class selectors while section1 is an id. It is important to pay attention to how each of them are used. By carefully using our CSS selectors, we can apply multiple styles and unique styles to any HTML element.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5dox5qyvmjyrvi42ficf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5dox5qyvmjyrvi42ficf.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  ii. What are the uniqueness of each CSS selector:
&lt;/h4&gt;

&lt;p&gt;It is important to know the uniqueness of each of these CSS selectors. The first way to establish this is by their usage in our styling. We can look at how they are used also in both our HTML and also in our CSS file.&lt;/p&gt;

&lt;p&gt;a. Looking at the way they are used or appear in each of our files.&lt;br&gt;
For &lt;strong&gt;HTML tag name:&lt;/strong&gt; if we have &lt;code&gt;&amp;lt;h2&amp;gt;Heading&amp;lt;h2&amp;gt;&lt;/code&gt; in our CSS we can say &lt;code&gt;h2 {our style}&lt;/code&gt;. Just like we have above, body and h3 are HTML tagname used in styling. For example the ash backgound-color on our output in our browser was a style applied to the body.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For Class:&lt;/strong&gt; we include &lt;code&gt;class="classname"&lt;/code&gt; within the opening tag of our HTML element. Looking at the usage, we use &lt;code&gt;.classname {our style}&lt;/code&gt; to apply a specific style to our an HTML element using the classname.Looking at our sample above, our h1, first paragraph and second h3 content has the color brown because of the style on the class brown. Look at the word brown in our HTML file and .brown in our style.css. With this we are able to apply same style to multiple elements using classes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For id:&lt;/strong&gt; it has almost the same implementation with class in our HTML file. The difference is that for id we use id in our html and in our css we use #idname to style it.&lt;/p&gt;

&lt;p&gt;b. Another way to consider their uniqueness is in the priority and peculiarity of each of them. In order of priority, id is the most. It is the most prioritised in an external styling, followed by a class and then HTML tagname.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;id&lt;/strong&gt; are the most unique and has special usage case which include the following:&lt;br&gt;
Unlike a class that can be used on many elements at a time, a particular id can not occur twice in an HTML file. It is the most prioritised in an external CSS styling.&lt;/p&gt;
&lt;h3&gt;
  
  
  4. Combination of different CSS selectors with examples:
&lt;/h3&gt;

&lt;p&gt;We can also combine the selectors to pick specific HTML elements to style in our CSS.&lt;/p&gt;
&lt;h4&gt;
  
  
  i. Pick &amp;amp; Mix Selectors
&lt;/h4&gt;
&lt;h4&gt;
  
  
  a. Multiple selectors
&lt;/h4&gt;

&lt;p&gt;a selector, another selector {&lt;/p&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Say we have an h1 and p with colour red.&lt;/p&gt;

&lt;p&gt;We can just have the below in our CSS file;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;h1, p {
    color: red;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  b. Hierarchical Selectors
&lt;/h4&gt;

&lt;p&gt;This is selected by hierarchy. That is selection based on the hierarchy of the selectors&lt;/p&gt;

&lt;p&gt;E.g&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#title .container-fluid {
    padding-top: 3%;
    text-align: left;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;selector1 selector2&lt;/p&gt;

&lt;p&gt;The first selector is a parent while the 2nd is a child.&lt;br&gt;
So in using this, we will go from outside in, selecting the parents till we get to the specific child.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container-fluid h1 {
color: red;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we read the hierarchy from right to left. The one on the right is the child and the one on the left is the parent.&lt;/p&gt;

&lt;h4&gt;
  
  
  c. Combined Selectors
&lt;/h4&gt;

&lt;p&gt;This is combining selector&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;selector1.selector2 {
   display: flex;
   padding: 20px;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;selector1#selector2&lt;/p&gt;

&lt;p&gt;We will read this from left to right.&lt;/p&gt;

&lt;h4&gt;
  
  
  ii. What is the difference between the one with space and one without space.
&lt;/h4&gt;

&lt;p&gt;Without the separator, we are targeting an element that has the classes we state but with the space it means we are following the hierarchy moving from the parent to child.&lt;br&gt;
It is good to remember this about selectors, they have hierarchy id's that are the most specific which means they take much priority and then classes and lastly HTML tags.&lt;br&gt;&lt;br&gt;
Also it is good to note that the last styling will always be applied.&lt;br&gt;
Also class selector is superior to HTML tag while id is superior to class and HTML tag. These are CSS rules.&lt;/p&gt;

&lt;p&gt;Then also inline CSS is the strongest when it comes to where our styling is positioned.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. How to avoid to avoid conflicting styling in our web design
&lt;/h3&gt;

&lt;p&gt;It is important to understand the ways and methods to avoid conflicting styling in our development. We can have style conflict when the style implemented by the browser is different from the one specified by the designer or the developer. This can be very frustrating at times.&lt;/p&gt;

&lt;h4&gt;
  
  
  i. Understanding conflicting styling in web design
&lt;/h4&gt;

&lt;p&gt;Conflicting styling is when the style on our page output by the browser is different from the one specified in our code. If you observe this, you can inspect the page by right clicking on the browser, then select inspect. Chrome is a good tool to see what style is applied on what element on the page.&lt;/p&gt;

&lt;h4&gt;
  
  
  ii. What are the major causes of conflicting styling
&lt;/h4&gt;

&lt;p&gt;Conflicting styling can occur from any of the following;&lt;br&gt;
a. Having multiple forms of styling. e.g having inline, internal and external or any two together.&lt;br&gt;
b. Having multiple style sources. This can cause style conflict that is not properly addressed or monitored.&lt;br&gt;
c. Omitting separators and proper formatting of styles.&lt;br&gt;
d. Improper linking of style files in HTML files.&lt;/p&gt;

&lt;h4&gt;
  
  
  iii. Ways and How to avoid conflict styling
&lt;/h4&gt;

&lt;p&gt;Ways to avoid conflict styling is to ensure to carefully attend to everything stated above and sticking to best practices in CSS styling.&lt;/p&gt;

&lt;h4&gt;
  
  
  iv. Principles and best practices in good CSS styling
&lt;/h4&gt;

&lt;p&gt;a. Use id's very sparingly. Not only that you have one of those things but that it is distinct so use class instead. Only use id when you need to but always consider using class first.&lt;br&gt;
b. When you want to use a class, always use one class. Try to apply to only one class as much as possible.&lt;br&gt;
c. Avoid inline styling as much as possible. It is a very bad practice so don't do it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Keeping to all the above helps you reduce debugging to the barest minimum.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Now that you have properly mastered CSS selectors and best practices for great styling, make further effort to refactor your previous stylings, practise what you have learnt and work on more web design projects using HTML, CSS and JavaScript.&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>developer</category>
      <category>frontend</category>
    </item>
  </channel>
</rss>
