HTML Classes | html div class
![HTML Classes](https://i.imgur.com/axBPWDg.jpg)
TheHTMLclassattributeisusedtospecifyaclassforanHTMLelement.MultipleHTMLelementscansharethesameclass.UsingTheclassAttributeTheclassattributeisoftenusedtopointtoaclassnameinastylesheet.ItcanalsobeusedbyaJavaScripttoaccessandmanipulateelementswiththespecificclassname.Inthefollowingexamplewehavethree
![HTML Classes](http://pix1.agoda.net/hotelimages/5059957/-1/5f63dc982bc37c5981773e411168efa4.jpg?s=800x)
The HTML class attribute is used to specify a class for an HTML element.
Multiple HTML elements can share the same class.
Using The class AttributeThe class attribute is often used to point to a class name in a style sheet. It can also be used by a JavaScript to access and manipulate elements with the specific class name.
In the following example we have three <div> elements with a class attribute with the value of "city". All of the three <div> elements will be styled equally according to the .city style definition in the head section:
Example .city { background-color: tomato; color: white; border: 2px solid black; margin: 20px; padding: 20px;}<div class="city"> <h2>London</h2> <p>London is the capital of England.</p></div>
<div class="city"> <h2>Paris</h2> <p>Paris is the capital of France.</p></div...
取得本站獨家住宿推薦 15%OFF 訂房優惠
本站住宿推薦 20%OFF 訂房優惠,親子優惠,住宿折扣,限時回饋,平日促銷
HTML Classes | html div class
HTML div tag | html div class
html中div id與div class什麼意思用法講解 | html div class
<div> | html div class
HTML <div> 區塊block 容器 | html div class
div id與div class什麼意思用法講解 | html div class
Divs, Spans, Ids | html div class
html中div id與div class什麼意思用法講解 | html div class
HTML DIV 標籤用法 | html div class
Span與div | html div class
HTML Classes | html div class
HTML <div> 區塊容器元素 | html div class
HTML div tag | html div class
<div>: The Content Division element | html div class
CSS 語法:選擇器class 與id 以及階層關係 | html div class
CSS 一般問題 | html div class
HTML div class Attribute | html div class
HTML && CSS 学习笔记(5)div、class(关键词 | html div class
HTML Div – What is a Div Tag and How to Style it with CSS | html div class
How To Add a Class Name | html div class
![](https://i.imgur.com/axBPWDg.jpg)
![](https://i.imgur.com/axBPWDg.jpg)
![](https://i.imgur.com/axBPWDg.jpg)