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





12 - - how do i get the current date in javascript
Can you send me examples of javascript code for the date, but also for the time.
I found some javascrip...


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...


76 - - best way how to make coffee in a kettle pot
Please, I want to know a recipe how to make coffee in a kettle pot best way and tasty.
I searched the...


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 ...


71 - - how to make slime with soap and water
Please, I want to know a recipe how to make slime with soap and water.
I searched on internet, followe...


25 - - how to make money as a kid
Can anyone explain how to make money as a kid. I heard there are a few methods already checked. Can anyone giv...


34 - - how to make cake pops with molds and without mold
I searched for a simple recipe on the internet but I did not find it. There is someone who followed a certain ...


26 - - how to make money as a student
Many websites show how to make money as a student, but, we have not found anything concrete.
Can anyone...


63 - - how to make slime without glue ingredients
Please, I want to know a recipe to make slime without glue ingredients. I searched on internet, followed the...


57 - - how to make rice milk at home
Please, who knows how to make rice with milk home. If you know, please send me a recipe about how to make rice...


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