HTML for me Part.2

 

over and over

 

※Caution

This article is written only with simple HTML elements("p","dl","h1", etc...)



Let's dive into more complicated part of HTML

Linkedin learning で記事書きたいね


Attributes

HTML attributes provide additional information about HTML elements.
・All HTML elements can have attributes
・Attributes provide additional information about elements
・Attributes are always specified in the start tag
・Attributes usually come in name/value pairs like: name="value"

Four major global attributes

  • Global class Attribute
  • Global id Attribute
  • lang Attribute
  • dir Attribute
What is Global Attributes??

Global Attributes are attributes that can be applied to any HTML elements

Four major global attributes in detail

Class

Allow us to target all elements with that class in OUR CSS or JavaScript.
It gives us a way to attach a reusable name to any elements.
We can address the name in our CSS and apply styling to all the elements that have that class

ID

Allow us to target a unique element with that ID in our CSS of JavaScript
It is helpful when interacting with JavaScript or links.

※These two Attributes are useful when editing with CSS
Lang

Tell the browser what language you are writing in

e.g.)This paragraph is written in American English

例)この段落は日本語で書かれています

Dir

Tell the browser in which direction the text flows.

This paragraph is written in English.It flows from left to right

この文章は日本語で書かれています。本来は左から右ですが、試しにdir="rtl"にするとこんな感じになります。

          

今日も一日お疲れ様です