1 Minute HTML tutorial - id and class with

Preview:

Citation preview

1 Minute HTML

id and class with <style>

using id and class,

you can style elements

both is <h1> …

… but you can style

only the one you select

Let’s see how

id works

id is an attribute

Then you define

style for the id

style for an id

starts with “#”

Only the one with the id

has the style

Let’s see how

to use a class

Multiple elements

with the same class

Multiple elements can have

the same “class”, but….

only a single element can

have the same ”id”

Then you define style

for the class

style for a class starts with “.”

style for a class starts with “.”

(style for an id started with #)

Only the elements with the class

get the style applied