ID in CSS·Specify astyle for a unique element by referringtothe“id"intheHTMLelement..The styleisdefined by"#"inCsS<head><style>#para1(Astyleparagraphcolor:red;Anotherstyleparagraph1</style></head><body><pid="para1">Astyleparagraph</p><pid="para1">Anotherstyleparagraph</p></body>
ID in CSS • Specify a style for a unique element by referring to the “id” in the HTML element. • The style is defined by “#” in CSS <head> <style> #para1{ color:red; } </style> </head> <body> <p id="para1">A style paragraph</p> <p id="para1">Another style paragraph</p> </body>
Class in Css·Specify a style for a unique of elements by referringtothe“class"intheHTMLelement..Thestyle is defined by""inCsS<head>Astyleparagraph<style>-para1(Anotherstyleparagraphcolor:red;1</style></head><body><pclass="para1">Astyleparagraph</p><pclass="para1">Anotherstyleparagraph</p></body>
Class in CSS • Specify a style for a unique of elements by referring to the “class” in the HTML element. • The style is defined by “.” in CSS <head> <style> .para1{ color:red; } </style> </head> <body> <p class="para1">A style paragraph</p> <p class="para1">Another style paragraph</p> </body>
Class in Css·You can also specify the specificHTMLelementsshouldbeaffectedbyaclass<head><style>Noeffectdiv.para1(Affectedcolor:red;</style></head><body><pclass="para1">Noeffect</p><divclass="para1">Affected</p></body>
Class in CSS • You can also specify the specific HTML elements should be affected by a class. <head> <style> div.para1{ color:red; } </style> </head> <body> <p class="para1">No effect</p> <div class="para1">Affected</p> </body>
Some Useful Elements - TableTable<table><th>head<tr>tablerow<td>tabledataOTable borderOTable widthand heightOTable colorOAlignmentOTable PaddingOHorizontalDividersOHoverableTableOApplystyletoaspecifictableO
Some Useful Elements - Table ◼ Table <table> <th> head <tr>table row <td>table data Table border Table width and height Table color Alignment Table Padding Horizontal Dividers Hoverable Table Apply style to a specific table