<?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 Ankita Chadha on Medium]]></title>
        <description><![CDATA[Stories by Ankita Chadha on Medium]]></description>
        <link>https://medium.com/@ankitac?source=rss-6eb8020dde7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*l3LcZjKzlKTGMZ7fnQ3GdQ.jpeg</url>
            <title>Stories by Ankita Chadha on Medium</title>
            <link>https://medium.com/@ankitac?source=rss-6eb8020dde7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 23:55:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ankitac/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[Ids vs. Classes]]></title>
            <link>https://medium.com/@ankitac/ids-vs-classes-4b50f591fb10?source=rss-6eb8020dde7------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b50f591fb10</guid>
            <dc:creator><![CDATA[Ankita Chadha]]></dc:creator>
            <pubDate>Tue, 16 Jun 2015 00:55:29 GMT</pubDate>
            <atom:updated>2015-06-17T18:22:10.656Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*X0HBuZawMgKAidyrxNetrA.png" /></figure><p>A fundamental concept in coding for the internet is the idea of ids and classes.</p><p>First, we will discuss ids and classes in HTML. You can assign an element (ie. &lt;p&gt;, &lt;img&gt;, &lt;h1&gt;, &lt;div&gt;, etc.) an id and a class as follows:</p><pre>&lt;img id=&quot;someImage&quot; class=&quot;imageClass&quot; src=&quot;hello.png&quot;/&gt;</pre><h4><strong>ID</strong></h4><ul><li>A unique identifier for an element</li><li>Use: to identify a single element on the page</li></ul><h4>Class</h4><ul><li>A way of characterizing an element that has the same attributes as other elements in that class</li><li>Use: to identify multiple elements that share common attributes</li></ul><p>Now we will extend our knowledge to cover how to add style to certain elements with a particular id/class in CSS.</p><p>In order to stylize a certain element in our HTML, the notation: #[name of id] allows us to access the element identified with the [name of id] while the notation: .[name of class] allows us to access the element(s) who belong to the class [name of class].</p><p>Consider the following HTML code:</p><pre>&lt;p id=&quot;text1&quot; class=&quot;editText&gt;Hey&lt;/p&gt;<br>&lt;p id=&quot;text2&quot; class=&quot;editText&gt;Hello&lt;/p&gt;<br>&lt;p id=&quot;text3&quot; class=&quot;editText&gt;Goodbye&lt;/p&gt;<br>&lt;p id=&quot;text4&quot; class=&quot;editText&gt;Howdy&lt;/p&gt;</pre><p>Say we are given the following specs:</p><ul><li>All the elements should have the same font</li><li>“Hey” should be colored red</li><li>“Hello” should be colored pink</li><li>“Goodbye” should be colored blue</li><li>“Howdy” should be colored green</li></ul><p>This is how we could stylize it in CSS:</p><pre>.editText{<br>     font-family: &quot;Times New Roman&quot;, Times, serif;<br>}</pre><pre>#text1{<br>     color: red;<br>}</pre><pre>#text2{<br>     color: pink;<br>}</pre><pre>#text3{<br>     color: blue;<br>}</pre><pre>#text4{<br>     color: green;<br>}</pre><p>And there you have it!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b50f591fb10" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>