<?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>Forem: Nzeamalu Nkechinyere Tere-joe </title>
    <description>The latest articles on Forem by Nzeamalu Nkechinyere Tere-joe  (@tere_joe).</description>
    <link>https://forem.com/tere_joe</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%2F1406805%2F04397282-4084-4e16-a9f1-53a86d52fdc9.png</url>
      <title>Forem: Nzeamalu Nkechinyere Tere-joe </title>
      <link>https://forem.com/tere_joe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/tere_joe"/>
    <language>en</language>
    <item>
      <title>Understanding CSS Cascade, Selectors and Specificity</title>
      <dc:creator>Nzeamalu Nkechinyere Tere-joe </dc:creator>
      <pubDate>Mon, 22 Apr 2024 10:51:32 +0000</pubDate>
      <link>https://forem.com/tere_joe/understanding-css-cascade-selectors-and-specificity-2058</link>
      <guid>https://forem.com/tere_joe/understanding-css-cascade-selectors-and-specificity-2058</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction to CSS Cascade&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A Cascading Style Sheet (CSS) is a language consisting of a set of rules that determines the layout of a webpage. We all understand to a certain extent that the page displays which rule comes later, i.e., the later rule overrides the earlier one. &lt;/p&gt;

&lt;p&gt;Frequently, you find out that a rule applied to an HTML page is not working. This situation might be so because multiple rules have been applied to the same element without knowing; this is where the cascading rules come into play. This article explains the method used to resolve conflicts in rules and how exactly a browser determines what style to apply to a specific element.&lt;/p&gt;

&lt;p&gt;The actual logic of CSS code is more complex and is based on a classification of rules. We will be discussing two of these rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The Cascading rule&lt;/li&gt;
&lt;li&gt;The Specificity rule&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cascading Rule
&lt;/h2&gt;

&lt;p&gt;The cascade denotes that the cascade layer, the CSS rule order, and the origin/weight are important. &lt;/p&gt;

&lt;p&gt;The CSS rule order simply states that when two rules from the same cascade layer both have equal specificity, the later rule will always override the earlier one. &lt;br&gt;
For example, if we have two exact rules that apply to the same &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; element. The &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; element ends up taking the last rule (color: blue). Although both rules are the same, have the same specificity, and originate from the same selector, the last rule in the source order is chosen.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`div{
  color: brown;
}
div{
  color: blue;
}
`

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Specificity Rule
&lt;/h2&gt;

&lt;p&gt;Specificity is the process that determines which property value is applied to an element by the browser when several style blocks have various selectors that configure the same property with different values and target the same element.&lt;/p&gt;

&lt;p&gt;When dealing with specificity, there are key things to note: &lt;br&gt;
The class selector is more specific and weightier. The class selector, the attribute selector, and the pseudo-classes selector all have the same weight.&lt;br&gt;
 The element selector and the pseudo-element selector have the same specificity and are less specific and weightier than the class selector.&lt;br&gt;
The ID selector is weightier than both the class selector and the element selector.&lt;/p&gt;

&lt;p&gt;For example, the &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; element with a class name of "main-div" is styled below. The &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; element will take the style of the class selector over the element selector because the class selector is more specific.&lt;br&gt;
&lt;/p&gt;

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

.main-div{
  color: blue ;
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three different values identified as IDENTIFIERS, CLASS, and ELEMENT are used to quantify the specificity of a selector:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Identifiers:&lt;/strong&gt; The Identifiers, popularly known as IDs, take the specificity of 100 points.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Classes:&lt;/strong&gt; Any class selector, attribute selector, or pseudo-class that is a part of the overall selector takes a specificity of 10 points.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Elements:&lt;/strong&gt; For any element selector or pseudo-element that is a part of the overall selector, it takes the specificity of 1 point.&lt;/p&gt;

&lt;p&gt;CSS styles applied directly to the HTML elements have 1000 points, while the !important statement gives a specificity of 10,000 points. &lt;/p&gt;

&lt;p&gt;Therefore, the rule is that the selector with the highest points takes the styling. In the case of having the same number of points for the same selectors, the one with the weightier elements takes the lead. In this regard: ID-CLASS-ELEMENT.&lt;br&gt;
For example;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#id div ul li a {
  color: yellow; Will give us 5 points: 1-0-4
}


#id div ul .nav a {
  color: white; Will give us 5 points: 1-1-3
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code is targeting the same elements but with different selectors. The second one wins and makes the text color white because it has a class selector which is weightier than the four/infinity element selectors in the first code. The first code has no class selector.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>css</category>
      <category>learning</category>
      <category>development</category>
    </item>
    <item>
      <title>History of the Internet</title>
      <dc:creator>Nzeamalu Nkechinyere Tere-joe </dc:creator>
      <pubDate>Thu, 04 Apr 2024 18:45:26 +0000</pubDate>
      <link>https://forem.com/tere_joe/history-of-the-internet-5c73</link>
      <guid>https://forem.com/tere_joe/history-of-the-internet-5c73</guid>
      <description>&lt;p&gt;&lt;strong&gt;History of the Internet&lt;/strong&gt;&lt;br&gt;
The Internet began in 1969 with the Advanced Research Projects Agency Network(ARPANET), which connected just four universities' computers. In 1991, the Internet was made accessible to the general public. &lt;/p&gt;

&lt;p&gt;Many people contributed to the creation of the Internet. But, J.C.R. Licklider was the first to imagine a network of interconnected computers. Other significant figures involved in creating the Internet are Tim Berners-Lee, the guy behind the World Wide Web, and Lawrence Roberts, who proposed and oversaw ARPANET for many years.&lt;/p&gt;

&lt;p&gt;The idea of the Internet began when the United States and the Soviet Union were involved in the Cold War throughout the 1950s and 1960s. Each nation was striving to improve its scientific and technological capacities to prevent nuclear assaults from one another and to maintain the ability to strike the other if things got out of hand. &lt;/p&gt;

&lt;p&gt;Compared to modern ones, computers back then were far more expensive and bulkier. Mainframe computers occupied large halls, and they could only perform specific functions. Researchers needed to access computers to do particular jobs, but they frequently had to travel considerable distances in search of a computer capable of performing specific work.&lt;/p&gt;

&lt;p&gt;The proposed solution involved connecting the computers so they could communicate with one another, enabling data sharing amongst researchers without requiring them to visit the computer's location. The issue with computers communicating with one another was that in the process of moving data, known as circuit switching, it needed to be faster, making it more prone to failure. Each piece of the data must be delivered in a single packet, and none of it would get through if the connection was lost in the process.&lt;/p&gt;

&lt;p&gt;To solve this issue, scientists created packet switching, an alternative technique. &lt;br&gt;
Packet switching could deliver the data in smaller chunks and send them separately for each segment. The smaller data sets are transferred more quickly, and in the event of an interruption, some of the data must have passed through, and the process may continue partially, saving a complete restart. The packets are combined into a single packet after the data arrives at its destination.&lt;/p&gt;

&lt;p&gt;At this point, the evolution of the Internet persisted. Through packet switching, computers communicate with one another using the ARPANET. Other networks were created after ARPANET, but computers could not communicate with one another. Therefore, a set of guidelines, the Transmission Control Protocol and Internet Protocol (TCP/IP), was created to address this issue. These regulations ensured packets sent over a network would reach their intended recipient and permitted universal communication across all networks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Domain Name System&lt;/strong&gt;&lt;br&gt;
Domain Name System (DNS) maps human-readable domain names (found in URLs or email addresses) to numerical Internet Protocol (IP) addresses, allowing devices to connect to the intended server or website.&lt;/p&gt;

&lt;p&gt;Going back in history to the development of the computer network ARPANET, now known as the Internet, some obstacles arose in hindering dependable communication in the face of equipment failure. No point or link on the ARPANET was intended to be more important than any other; this situation was, therefore, accompanied by the development of redundant routes and data rerouting in the event of network failure in a component.&lt;/p&gt;

&lt;p&gt;Every host on the ARPAnet has their name-to-address mapping in a single location file named HOSTS.TXT. The Network Information Centre at SRI was in charge of this file.&lt;br&gt;
Three issues with this configuration arose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Name collisions: Every host was required to have a unique name, and network users might add hosts with conflicting (non-unique) names without the help of a centralized authority, thereby "breaking the whole scheme."&lt;/li&gt;
&lt;li&gt;Consistency: It became impossible, or at least very difficult, to update the file and ensure all hosts got the most recent version.&lt;/li&gt;
&lt;li&gt;The responsible host found it too much to handle the traffic and strain of distributing the file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because of HOSTS.TX was a single point of failure; this method struggled to scale over a certain number of hosts. &lt;br&gt;
A scalable and decentralized solution was required for ARPAnet, which was DNS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Components of DNS&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DNS Server: DNS operates through a distributed network of DNS servers. These servers store and manage information about domain namespace and IP addresses.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;DNS Resolver: Your computer or network device (e.g., router) typically has a DNS resolver that handles DNS queries. When you request a domain name, the resolver communicates with DNS queries. When you request a domain name, the resolver communicates with the &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;DNS servers to resolve the domain to an IP address.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Domain Name: Unlike an IP address, a domain name is significantly more straightforward to memorize and type into a terminal or web browser.&lt;br&gt;
Although a domain name is a URL component, the two are not interchangeable. A domain name is the name of a website and is a sub-component of every URL, whereas a URL is the whole web address of a resource.&lt;br&gt;
Every domain has two components: the top-level domain (TLD) and the second-level domain (SLD). A domain name's components get increasingly specific as they move from the right (end) to the left (beginning). For example, let's look at "behance.com":&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;URL: &lt;a href="https://ww.behance.com"&gt;https://ww.behance.com&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Domain name: behance.com&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;TLD: com&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SLD: behance&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Network Packet&lt;/strong&gt;&lt;br&gt;
A network packet is a basic data unit grouped and transferred over a packet-switched network like the Internet. Each packet or data chunk forms part of a complete message and carries relevant address information that helps identify the sending computer and intended recipient.&lt;/p&gt;

&lt;p&gt;A network packet has three parts: the packet header, payload, and trailer. A network packet's size and structure depend on the underlying network structure or protocol. Conceptually, a network packet is similar to a postal package. The box or envelope, in this case, represents the header, the content is the payload, and the signature is the trailer. Instructions about the packet's data are contained in the header.&lt;/p&gt;

&lt;p&gt;A network packet travels to its destination by selecting the quickest route possible. All subsequent packets in a message follow this path, increasing efficiency. For example, when equipment malfunctions during message transmission, routers redirect the packets to ensure the entire message reaches its destination.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;File Transfer Protocol&lt;/strong&gt;&lt;br&gt;
File Transfer Protocol (FTP) is a standard network protocol that transfers files between a client and a server on a computer network, such as the Internet. It is widely used for uploading, downloading, and managing files on remote servers.&lt;/p&gt;

&lt;p&gt;For FTP to function, two connections must be established between the systems attempting to communicate. The data transport is handled by one channel, while the other is reserved for the orders and responses transmitted back and forth between the two clients. Four instructions are used by the machines, servers, or proxy servers that are talking during an FTP transfer. These instructions are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Send.&lt;/li&gt;
&lt;li&gt;Get.&lt;/li&gt;
&lt;li&gt;Change Directory.&lt;/li&gt;
&lt;li&gt;Transfer.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Hypertext Transfer Protocol&lt;/strong&gt;&lt;br&gt;
The Hypertext Transfer Protocol (HTTP) loads web pages using hyperlinks. The World Wide Web is built on HTTP, which loads web pages using hypertext links. &lt;/p&gt;

&lt;p&gt;HTTP is designed to move information between networked devices; HTTP is an application layer protocol that operates on top of other network protocol stack layers. A typical HTTP flow is when a client computer delivers a request to a server, and the server replies with a message.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;An HTTP Request&lt;/strong&gt;&lt;br&gt;
An HTTP request is a message a client sends (e.g., a web browser) to a server requesting a specific action or resource. Web browsers and other Internet communications platforms request the data they require to load a page using an HTTP request. A collection of encoded data, including various kinds of information, is sent along with every HTTP request sent over the Internet.&lt;br&gt;
 An HTTP request typically includes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;HTTP version type&lt;/li&gt;
&lt;li&gt;a URL.&lt;/li&gt;
&lt;li&gt;An HTTP method.&lt;/li&gt;
&lt;li&gt;HTTP request headers.&lt;/li&gt;
&lt;li&gt;Optional HTTP body.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>productivity</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
