반응형
CSS has two type of element.
class
Class starts with period(.) in css format
Class likes this format
/* Style the element with the id "myHeader" */
#myHeader {
background-color: lightblue;
color: black;
padding: 40px;
text-align: center;
}
id
id starts with sharp(#) in css format
Id likes this format
/* Style all elements with the class name "city" */
.city {
background-color: tomato;
color: white;
padding: 10px;
}
</style>
My Cities
London
London is the capital of England.
Paris
Paris is the capital of France.
Tokyo
Tokyo is the capital of Japan.
Chapter Summary
The id attribute is used to specify a unique id for an HTML element
The value of the id attribute must be unique within the HTML document
The id attribute is used by CSS and JavaScript to style/select a specific element
The value of the id attribute is case sensitive
The id attribute is also used to create HTML bookmarks
JavaScript can access an element with a specific id with the getElementById() method
반응형
'TECH' 카테고리의 다른 글
SELECT (0) | 2022.04.12 |
---|---|
레노버 P11 K11 XIAOXIN PAD, P11 PRO(2020), P11 PLUS - 관부가세 포함 무료배송 (0) | 2022.04.06 |
https://velog.io/@hjkdw95/요즘-핫한-slide-up-형태의-carousel-만들기 (0) | 2022.03.14 |
Html block and inline elements (0) | 2022.03.11 |
[phython] anaconda (0) | 2021.06.03 |