HOME | PHP Tutorial | CSS
facebook icon
AgerNic.com
WEB DEVELOPER SITE, HTML, CSS, PHP
HTML Tutorial

CSS Tutorial
11 - ID
2 - IDCATEGORY

What is the difference between id and class in html css


I want to know what is the difference between id and class in html and css if it is any.
I read somewhere that id's are unique and there can be only one element with corresponding id, and classes can be applied to many elements.
But I think this is wrong I have a code in which I have applied a single id to two elements.
<p>&lt;!DOCTYPE html&gt;<br /> &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;<br /> &lt;head&gt;<br /> &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;<br /> &lt;title&gt;difference between id and class in html css&lt;/title&gt;<br /> &lt;/head&gt;</p> <p>&lt;body id=&quot;top&quot;&gt;<br /> &lt;p id=&quot;top1&quot;&gt;difference between id and class in html css&lt;/p&gt;<br /> &lt;p id=&quot;top1&quot;&gt;Hello World where is the difference&lt;/p&gt;</p> <p>&lt;/body&gt;<br /> &lt;/html&gt;</p> here is my CSS<br/>
#top1{ <br/> background-color:green;<br/> width:400px;;<br/> height:200px;<br/> margin-left:20px;<br/> margin-right:25px;<br/> text-align:center; <br/> font-size:18px; <br/> }
What is the difference between id and class in html css

11 2 - Name: what is the difference between id and class in html css
I want to know what is the difference between id and class in html and css if it is any.
I read somewhere that id's are unique and there can be only one element with corresponding id, and classes can be applied to many elements.
But I think this is wrong I have a code in which I have applied a single id to two elements.
<p>&lt;!DOCTYPE html&gt;<br /> &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;<br /> &lt;head&gt;<br /> &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;<br /> &lt;title&gt;difference between id and class in html css&lt;/title&gt;<br /> &lt;/head&gt;</p> <p>&lt;body id=&quot;top&quot;&gt;<br /> &lt;p id=&quot;top1&quot;&gt;difference between id and class in html css&lt;/p&gt;<br /> &lt;p id=&quot;top1&quot;&gt;Hello World where is the difference&lt;/p&gt;</p> <p>&lt;/body&gt;<br /> &lt;/html&gt;</p> here is my CSS<br/>
#top1{ <br/> background-color:green;<br/> width:400px;;<br/> height:200px;<br/> margin-left:20px;<br/> margin-right:25px;<br/> text-align:center; <br/> font-size:18px; <br/> }





75 - - how to make turkish coffee in a pot on the stove
Please, I want to know a recipe how to make turkish coffee in a pot on the stove best way and tasty.
...


60 - - how to make rice water for baby babies
Please, who knows how to make rice water for baby - babies. If you know, please send me a recipe about how to ...


11 - - what is the difference between id and class in html css
I want to know what is the difference between id and class in html and css if it is any.
I read somewhe...


13 - - sql server date format
Hi,
How can I convert datetime to date sql server?
How can i extract date from datetime sql?

64 - - how to make slime without glue with 1 or 2 or 3 ingredients
Please, I want to know a recipe to make slime without glue with 1, 2 or 3 ingredients. I searched on internet,...


24 - - how to make money as a teenager reddit
I heard that you can make money online on reddit. Can anyone explain to me how this can be done, how to use re...


84 - - how to create a website with wordpress from scratch free pdf
Please, I want to know how to create a website with wordpress from scratch free pdf step by step and if possib...


83 - - how to create a website from scratch using html and css
Please, I want to know how to create a website from scratch using html and css step by step and if possible wi...


73 - - how to make coffee without a coffee maker with milk home
Please, I want to know a recipe how to make coffee without a coffee maker with milk at home tasty.
I ...


82 - - how to create a website with database for free in dreamweaver
Please, I want to know how to create a website with database for free in dreamweaver step by step and if possi...