<?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: Abu Nasar</title>
    <description>The latest articles on DEV Community by Abu Nasar (@abunasar).</description>
    <link>https://dev.to/abunasar</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%2F1210689%2F7dd11383-89d1-4014-a299-eb3a982db956.jpeg</url>
      <title>DEV Community: Abu Nasar</title>
      <link>https://dev.to/abunasar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abunasar"/>
    <language>en</language>
    <item>
      <title>CSS Selectors and Pseudo-element.</title>
      <dc:creator>Abu Nasar</dc:creator>
      <pubDate>Mon, 26 Feb 2024 19:31:01 +0000</pubDate>
      <link>https://dev.to/abunasar/css-selectors-and-pseudo-element-cjb</link>
      <guid>https://dev.to/abunasar/css-selectors-and-pseudo-element-cjb</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4kbqwj4me0xwal9jt66l.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4kbqwj4me0xwal9jt66l.jpg" alt="Image description" width="550" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is CSS?
&lt;/h2&gt;

&lt;p&gt;CSS stands for &lt;strong&gt;Cascading Style Sheet&lt;/strong&gt; language which describes how a document is written in a markup language like(HTML) should be displayed and presented. CSS determines how the HTML is displayed on the screen it beautifies the HTML pages to look good. Using CSS we can add color, background, font, width, height, layouts and many more can be done using CSS on HTML document.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why CSS is important?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Separation of concern&lt;/strong&gt;: Keeps your website's content(HTML) separated from it style(CSS). It keeps the code cleaner, more readable and easier to maintain and update.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reusability&lt;/strong&gt;: We can use CSS Rule in multiple HTML. Once we write we can use it anywhere no need to write again and again. It saves time and makes website styling consistent.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Flexibility&lt;/strong&gt;: It gives you a ton of control over the visual presentation of your website.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;User Experience&lt;/strong&gt;: CSS create a Visually appealing, user-friendly website that can adapted by any browser.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How does CSS work?
&lt;/h2&gt;

&lt;p&gt;There are lots of concepts about how CSS works but we will go through only what is important.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Selectors&lt;/strong&gt;: Selectors target the HTML element that we want to style.
There are many types of selectors.&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Basic Selector&lt;/strong&gt;
&lt;strong&gt;1)Universal Selector:&lt;/strong&gt; It selects all elements of the HTML to 
  apply all CSS over all tags. * is used to select all 
  elements.
  uses: Removing default browser margins and padding to 
        create a consistent baseline:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   *{
    padding:0
   }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2)Individual Selector:&lt;/strong&gt; when we want to target specific&lt;br&gt;&lt;br&gt;
    elements from that HTML document then we use an individual &lt;br&gt;
    selector i.e. [tag name]{}. &lt;br&gt;
    This is a more specific selector than a universal selector.It &lt;br&gt;
    means we put any CSS property inside an individual selector &lt;br&gt;
    that overrides the default.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Class and ID selector&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Class Selector:&lt;/strong&gt; This selector is used to target specific class attributes. Classes can be reused all over the document.&lt;br&gt;
ex .important-text{properties:values}&lt;br&gt;
ID Selector: This selector is used to target unique element with specific ID attributes. ex #header{properties:values}&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;AND(chaining) &amp;amp; Combined Selector&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;AND Selector&lt;/strong&gt;: Combining multiple selectors to target elements with high specificity. To use this, chain multiple selectors together with a dot(.) in between.&lt;br&gt;
&lt;code&gt;div.container p { &lt;br&gt;
   color: red;&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Combined Selector&lt;/strong&gt;: Applying the same styles to several different &lt;br&gt;
targets simultaneously.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;h1, h2, p {&lt;br&gt;
  font-family: Arial, sans-serif;&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;-&lt;strong&gt;Descendant Selector&lt;/strong&gt;&lt;br&gt;
Selects elements that are descendants of a specified parent element.  It uses a space ()  between selectors to signify this relationship. Syntax:  ancestor descendant { /* Styles applied here */ }&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ul li {
     list-style-type: circle;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;IMPORTANT POINT OF DESCENDANT SELECTOR&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Nesting:&lt;/strong&gt; You can chain multiple descendant selectors for more specific targeting. Example: div section article p { ... }&lt;br&gt;
&lt;strong&gt;Specificity:&lt;/strong&gt; Less specific than child selectors (which use &amp;gt;) because they select elements at any nesting depth, not just direct children.&lt;br&gt;
&lt;strong&gt;Flexibility:&lt;/strong&gt; It's one of the most versatile CSS selectors since it can target elements many levels down the hierarchy.&lt;/p&gt;

&lt;p&gt;-&lt;strong&gt;Child Selector (&amp;gt;)&lt;/strong&gt;: Targets Elements that are direct children of another element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; ul &amp;gt; li {
                 list-style-type: disc;
               }

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Adjacent Sibling Selector (+)&lt;/strong&gt;: Targets an element immediately following a sibling element.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                p + p { 
                 margin-top: 2em;
                 }

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;General Sibling Selector (~)&lt;/strong&gt;: Targets elements that follow a sibling, with possible elements in between. This means targets all siblings of an element.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Pseudo Selector&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1) &lt;strong&gt;Pseudo class Selector&lt;/strong&gt;: Target an element based on its &lt;br&gt;
  state, position, or user interaction.&lt;/p&gt;

&lt;p&gt;Syntax :selector:pseudo-class { /* Styles applied here */ }&lt;br&gt;
  Example&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dynamic States:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;:hover&lt;/strong&gt; (mouse hovering)&lt;br&gt;
 &lt;strong&gt;:focus&lt;/strong&gt;(element has keyboard focus)&lt;br&gt;
 &lt;strong&gt;:active&lt;/strong&gt; (element is being clicked)&lt;br&gt;
 &lt;strong&gt;:visited&lt;/strong&gt;(for styling visited links)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Structural Relationships&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;:first-child&lt;/strong&gt; (targets the first child of its parent)&lt;br&gt;
&lt;strong&gt;:last-child&lt;/strong&gt; (targets the last child of its parent)&lt;br&gt;&lt;br&gt;
&lt;strong&gt;:nth-child()&lt;/strong&gt; (targets elements based on their position &lt;br&gt;
   using a formula)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; /* Links get an underline on hover*/
         a:hover { 
          text-decoration: underline;
       }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2) &lt;strong&gt;Pseudo-elements&lt;/strong&gt;: Style specific parts of an element or insert content that's not present in the HTML.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common Examples:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;::before&lt;/strong&gt;, &lt;strong&gt;::after&lt;/strong&gt; (insert content before or after the &lt;br&gt;
element's content)&lt;br&gt;
&lt;strong&gt;::first-lette&lt;/strong&gt;r (style the first letter of a block element)&lt;br&gt;
&lt;strong&gt;::first-lin&lt;/strong&gt; (style the first line of a block element)&lt;br&gt;
&lt;strong&gt;::selection&lt;/strong&gt; (style text that has been highlighted by the user). This is a CSS pseudo-element. It targets the portion of an element that is currently selected by the user (highlighted with their mouse or keyboard).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  li::before {
                      content: "✔ ";  /* Insert a checkmark */
                      color: green;
                      margin-right: 5px;
                 }


             /* selection example */

      &amp;lt;p&amp;gt;This text has normal selection.&amp;lt;/p&amp;gt;
      &amp;lt;p class="important"&amp;gt;This selection is more noticeable!&amp;lt;/p&amp;gt;

          ::selection {
           background-color: light-blue; 
           color: white;
     }

          .important ::selection {
          background-color: orangered;
          color: black;
         }

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

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;If you found this blog post helpful, please share it with others who might be learning CSS!&lt;br&gt;
_&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>webdev</category>
      <category>css</category>
      <category>html</category>
      <category>coding</category>
    </item>
    <item>
      <title>Introduction to Web and HTML.</title>
      <dc:creator>Abu Nasar</dc:creator>
      <pubDate>Thu, 16 Nov 2023 09:27:38 +0000</pubDate>
      <link>https://dev.to/abunasar/introduction-of-web-and-html-2aol</link>
      <guid>https://dev.to/abunasar/introduction-of-web-and-html-2aol</guid>
      <description>&lt;p&gt;&lt;em&gt;Mainly web is WWW(World Wide Web or the web) is a system interconnected with documents and other resources like URL, hyperlinks. It is accessed via the internet using web browsers like Chrome, Firefox. It allows the user to navigate web pages.&lt;br&gt;
Before going to what is server, client... we need to understand how web pages are created.&lt;br&gt;
web pages created with the help of HTML(hypertext markup language), CSS(cascading style sheet) and JavaScript. But CSS and JavaScript help html for styling and add functionality so we can say that HTML is first step of web pages&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;we can say that HTML is used to create web pages.&lt;br&gt;
HTML describe the structure of web pages. It means HTML specifies the hierarchical structure of content and create relationship between the different part of a document. Before going to depth in html like tag, element, attributes, title etc. we need understand how this web pages work.&lt;/p&gt;

&lt;p&gt;Now, it's time to understand the server and client.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;what is web server?&lt;/strong&gt;&lt;br&gt;
A web server is a software application or a hardware device that stores, processes, and serves web pages to users over the internet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How It works?&lt;/strong&gt;&lt;br&gt;
When a user requests a web page, The web server processes the request and sends the resources back to the user's browser.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;where web installed?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Web server installed on physical machine or cloud server. common Web server is Apache, Nginx, and Microsoft IIS.&lt;br&gt;
most of organization prefer Cloud servers because it provide scalability, flexibility, and the ability to pay for resources on a usage basis. Popular cloud providers include Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How Server receive data?&lt;/strong&gt;&lt;br&gt;
Web servers receive data through HTTP requests. When a user accesses a webpage, their browser sends an HTTP request to the web server, which responds with the requested content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Connection with Client&lt;/strong&gt;&lt;br&gt;
The client (browser) and server communicate via the HTTP/HTTPS protocol. The server sends HTML, CSS, and other files, and the client renders the webpage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Then one question arises is why we use C-panel to Manage server why we don't use Apache, Nginx directly.&lt;/strong&gt;&lt;br&gt;
cPanel is a web hosting control panel that simplifies server management. It provides a user-friendly interface for tasks like website configuration, file management, and email setup.&lt;br&gt;
In summary, a web server processes client requests, serves web content, is installed on dedicated machines, communicates with clients via HTTP, and popular servers include Apache, Nginx, and IIS. cPanel is a control panel for simplified server management in web hosting.&lt;br&gt;
Mainly C panel is provided by web hosting company Godaddy ,Hostinger, Bluehost&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Then what is the difference between ,for example,hostinger and Apache?&lt;/strong&gt; &lt;br&gt;
&lt;strong&gt;Hostinger is a web hosting company&lt;/strong&gt;. It provides services that allow individuals and organizations to make their websites accessible via the World Wide Web.&lt;br&gt;
&lt;strong&gt;Apache, on the other hand&lt;/strong&gt;, is a web server software. It's one of the most widely used web servers globally. Apache is responsible for handling incoming HTTP requests from clients (such as web browsers) and serving the requested web pages or resources.&lt;br&gt;
When you host your website with a service like Hostinger, behind the scenes, the hosting infrastructure uses web server software to handle requests and serve web pages. Hostinger may use a variety of web server software, and Apache is one of the popular choices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This all discussion regarding hosting but again one concept left that how html pages work why only index.html is written.&lt;/strong&gt;&lt;br&gt;
"index.html" serves as the default landing page of a website. When a user visits a website without specifying a particular file or page, the web server looks for "index.html" and, if found, sends it as a response.&lt;br&gt;
This file typically contains the main content and structure of the website, and it's the starting point for users exploring the site.&lt;br&gt;
"index.htm," "default.html," or "home.html" might also be considered default documents.&lt;/p&gt;

&lt;p&gt;Pleaselike and share if you like this content.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
