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/> }





35 - - how to make cake pops with cream cheese frosting resipe
I tried to make make cake pops with cream cheese frosting following an internet recipe, but it did not evolve ...


17 - - how to make money on youtube
I saw on the internet that you can make money online with youtube.com. You have idea what kind of videos would...


39 - - how to make cake from scratch without milk or eggs
Please, I want to know a recipe for how to make cake from scratch without milk or eggs simple and without too ...


16 - - how to make money in gta 5 online pc
I saw on the internet that you can make money online with gta 5 online pc. I found many opinions but nothing s...


36 - - how to make red velvet cake pops with cream cheese frosting
If anyone knows a simple recipe how to make red velvet cake pops with cream cheese frosting. Please write me a...


32 - - how to make cake pops recipe
Can anybody give me a simple recipe and easy for cake pops with as much detail as possible....


72 - - how to make slime with baking soda and shampoo
Please, I want to know a recipe how to make slime with baking soda and shampoo.
I searched on internet...


65 - - how to make slime with glue and tide
Please, I want to know a recipe to make slime with glue and tide.
I searched on internet, followed the ...


27 - - how to make money as a student without a job
Can someone give me some clues how to make money as a student without job ?...


77 - - how to make coffee in a french press coffee maker
Please, I want to know a recipe how to make coffee in a french press coffee maker best way and tasty.
...


Minimum length is 2
Your add here
How to get PHP errors to display?
How to prevent sql injection in php mysqli
How do I get PHP errors to display - PHP error_reporting()
mysql_query(): The mysql extension is deprecated and will be removed i
Function eregi_replace() is deprecated in php - How to fix
PHP delete an element from an array
Uncaught Error: Call to undefined function MYSQL_NUM_ROWS() in
Deprecated: mysql_connect() mysql extension is deprecated and will be
mysqli_fetch_array() expects parameter 1 to be mysqli_result boolean g
SQL IN Operator - example
SQL BETWEEN Operator
SQL like syntax and example
SQL WHERE AND & OR multiple conditions
SQL create table primary key autoincrement
PHP mysqli_connect () Function
SQL COUNT(), AVG() and SUM() Functions
Display data from SQL database with MySQLi into php - html table
SQL CREATE DATABASE - example
SQL mysql order by columns, by date, by asc, by desc, random with PHP
PHP mysqli_query() Function - mysqli query
SQL delete row - SQL delete table
SQL update - SQL update select
Insert into SQL - Insert into table SQL - Insert data in sql
Login in PHP - simple login script with PHP MYSQL