HTML && CSS
HTML && CSS
<hr> or <hr/>: called horizontal row and this formula called single tag
Quirks Mode Quirks Mode The browser behaves like it did in 1999 to
support old websites with bad code.
Head tags
Write informations about the web to give information to search engines to rank
your web like description, title
Body tags
Any thing appear to user like photo, vedio, text
Note
Any change in elements at browser : it’s temporary, just refrash the change will
disappear
Single tags
Major of people remarks single tag by put / like <meta/> but write like this is right
<meta>
Attribute
Any thing wrote behind tag called Attribute like
At html tag
We determine lamguage of website by add
we determine language of web cuz inform browser engines the language of your
website
At meta tag
<meta charset="UTF-8">
tells the browser which character encoding to use when displaying the webpage.
UTF-8
is a universal encoding that supports all languages, including Arabic and emojis,
and helps show text correctly.
Interview question
Want to move user from website to another after interval of time by using HTML
only
<meta http-equiv="refresh" content="5
url=[Link]
Css files
To connect css with html use
Note
javascript
To connect js with html use
<script></script>
o U wirte js at script tag
<script src=""></script>
o U put the file location of js if js isolated at file
Elements divided into
Block
Elements take 100% of view of his up
U can know block elements by background color “color take all up view” or
inspects at browser from display
o <p> </p>
o <li> </li>
o <div>
Inline
Elements that take view according to the content that found at itself
U can know inline elements by background color “color take the view of
content only” or inspects at browser from display
o We use align attribute at paragraph tags but now it isn’t supported by HTML5
Now
Interview question
Why we don’t use attribute of align ?
When use attribute of align, by defualt he makes option of text-align at CSS file.
So from my mind “ ”بالعقل كداI went to make it at css file direct instead of this
Note
Any thing write at HTML5 and colored with red it means that this thing isn’t
supported now
Bold text
Strong tag : used for making words bold and refer that sentence is important
italic text
em tags : emphasize text “aslo italic” used when wrote “ حكمه او الجمل المقتسبه او
”عباره بس من لغه مختلفه
underline text
ins tag : used for inserted text “”بقول للعميل ان الكالم دا لسه متحط او جديد في الويب سايت
midline text
Move words
Sub tag : sub script move word down, popular use is chemical reactions H 2O
Sup tag : super script move word up, popular use is power of variable x 2
other tags
images
to insert image
must image be in folder behind html file to insert image with easy way
offline
image at folder away from html file
o just put the address of file then / or \ then name of image
extenstion [Link] for instance
image at folder behind html file
o write name of folder / name of image extenstion
description of image
just write descriptive text for image to appear to user when cuz error like network
or image deleted
attributes of image
these attributes doesn’t used at HTML5, we edit all these things by CSS
used for giving user description about image, sentence, paragraph, anything
audio
if I have
one extension
<audio src="" controls></audio>
o Put source of file only and must write controls, to appear audio at page
type attribute
Tells the browser the media file’s format so it can decide whether it can play it or
skip it.
MP3 audio/mpeg
OGG audio/ogg
WAV audio/wav
AAC audio/aac
M4A audio/mp4
media types
attributes at audio
<audio src=" " controls loop muted autoplay> </audio>
o Loop : make sound repeated automatically but must user start audio by
himself
o Muted : make sound mute until user unmute it
o Autoplay : works under specific conditions, it makes sound work
automatically when user enter website
Video
Attributes of video
It’s look like audio at insterting
Autoplay
o we can make it here but must muted setted
Preload
Auto
o it’s special for user cuz preperation downloading video for user to
watch easy
o “”المستخدم ميستناش الفيد يحمل
o but it makes website is too heavy
none
o video doesn’t download any thing until user play it.
o this make lightly website
metadata
o it downloads the informations of video not the media of it
Note
Poster
o it’s image appear before playing the video “background for it”
Tr tag
o express row
Td tag
o express column
Th tag
o express important column
Caption tag
o express the description or title of table
attribute
Colspan attribute
o merge number of columns u write it
Suadi attribute
o merge number of rows u write it
List
Type of list
Unorder list
o Using it moreeeee than other lists
o <li> : called List item
Order list
Attributes
Type
reversed
start
Description list
Low using this list
dt tag
o Description term, used for writing item u want to put definition or description
to him
dd tag
o description details, used for writing definition to previous element or item
semantic elements container
container
website u build it, divided into parts so each part in site called container and
express container by div tag
HTML5 containers
semantic elements tags
Feature is added in html5 to make engines “ ”متتلغبطشand easy to understand your
website
semantic elements
it’s same div exactly but descriptive for each part
u can use div tag instead of tags of semantic elements but the best practice to
engines is tags of semantic elements
link
anchor tag
o used for directed user to internal or external website, image, mail, phone
number,
o done js code “not used now”
target
o default is same “_self” : open link at the same tab
o “_blank” : open link at new tab
URL
Divide into
Absolute
o Websites like Facebook, YouTube
Relative
o Website found at your folder, image
input from user
Label
For attribute
name that u put it at label refer to input u connect it to him, just double click on
name of label after write for
type of input
submit
reset
attribute
value
o it’s change the name of button
or
o hold the info at المكان الي بتدخل فيه المعلوماتand user can edit on it
placeholder
o hold the info u write it at المكان الي بتدخل فيه المعلومات
o it will hide when user start writing
o user can’t edit on it
required
o when u write it at specific input, so browser can’t send info without the input
u write this attribute at it
name
o is the name of the field. The backend uses it to identify the data that is being
sent to it.
o Must name found to transfer data, without it data can’t be sent
feildset tag
o make bord or background for your data
legend tag
o this title for field tag
form tag
attribute
action
when u click to submit, the browser will move u to URL u put it at action
query string
o it’s data that appear after ? that found in URL, appear by method = “get”
that found at form attributes or by default
o this is data that transfer to back end
o it can’t appear when put post at method attribute
method : post
method : get
Typing Css
Internal Css
By using style tag at head of html
External Css
By link tag to link to an external file
Inline Css
By using style attribute inside html elements
Link
Rel : explain the relationship between the file and html
Attributes of Css
Color
Font-size
Font-weight
Attributes at {}
o Just write name of element, style will apply to all elements founded
Class
Id
*{}
Attribute of
Class
If we have 2 numbers
Margin auto
بيوسطن المساحه الخارجيه ملهوش دعوه بالكونتنت المكتوب
Work at horizontal only, doesn’t work with vertical
%
Attribute of
All of this apply on block elements only not inline and talk about
percentage here
Width
height
max-height
border-radius
1 number
2 numbers
o Top left & bottom right , top right & bottom left
4 numbers
Inline element
when u insert image, by default it’s repeat if u want stop repeat use
o background-repeat: no-repeat;
o and default value is : repeat
o background-attachment: fixed;
o default value is : scroll
بيتسميscope علطول الي موجودين في نفس الselected element الي بعد الelement ال
Adjacent Sibling Selector
Execution done on
the after sibling selector element only
All sibling elements found after selected element when all at the same scope only
Execution done on
the after sibling selector element only
[attribute = “value”]
o Means execute code on any element have this attribute with this value
Element [attribute]
o Means execute code on specific element have this attribute
[attribute ^= “value”]
o Means execute code on any element have this attribute when start with
specific value
[attribute $= “value”]
o Means execute code on any element have this attribute when end with
specific value
[attribute *= “value”]
o Means execute code on any element have this attribute with specific value
مش هتفرق موجوده في األول وال النهايه المهم تبقي موجودهvalue of attribute
[attribute ~= “value”]
o Means execute code on any element have this attribute with specific value
If we put i after the value word this بتلغيcase sensitive like this
[attribute *= “value” i ]
الكود هيشتغل عاديlower case وانت روحت كتبتهاupper case مكتوبهvalue يعني لو كانت ال
][ في اخر الi بشرط تكون حاطط ال
Translate of elements
Transform
Translate()
o It moves the element with the direction x and y
o If u give one number, it will move the element at x-axis only
o If number is negative, it moves opposite direction
o Default value is (0px,0px)
Scale value()
o Control at volume of element and content of element together “zoom in-
out”
o Default value is 1
o If u want magnify element put number > 1
o If u want small element put number < 1
o If he take number with negative value, it will flip ” ”يشقلبthe element
o Scalex() : control at width
o Scaley() : control at height
Rotate value()
o Make element and it’s content rotate together
o U give it degree (60deg)
o Rotatex() : it’s rotate about x-aixs
o Rotatey() : it’s rotate about y-aixs
skew value()
o it makes deviation for element and it’s content from x-axis and y-axis
o default value is (0,0)
o If u give one number, it will deviate the element at x-axis only and consider
deviation from
y-axis is zero
o Skewx() : deviate form x-axis
o Skewy() : deviate form y-axis
Block elements
Apply margin at all directions
Display : Inline-block
Make element takes advantages of inline and block together . try it
Type of pages
Single page SPA
o A Single Page Application is a website that loads only one HTML page.
o When you click on buttons or links, the content changes without reloading
the whole page.
o The changes happen using JavaScript.
Key Points:
Key Points:
<!-- ✅ التذييل-->
<footer>
<p>© 2025 My Website. All rights reserved.</p>
</footer>
</body>
Flex-Boxparents
Display : flex
الزم اكتبها في ال upعشان ال children or itemsتستجيب
Value of inline-flex
لو كتبتها في ال upهيتشكل علي حسب حجم ال itemsالي عندو
Flex-direction
لما بكتبها في ال upف بيحددلي ال itemsشكلها يبقي عامل ازاي هل هي تترتب as row or
column
بعد ما بحدد row or columnف ال itemsبتترتب علي حسب اتجاه الصفحة يعني لو كان عندي اتجاه
الصفحة rtlف ال itemsهتترتب من اليمين للشمال ولو ltrف ال itemsهتترتب من الشمال لليمين
"دا الطبيعي لو لغة الصفحة انجليزي"
Value of flex-direction
Row-reverse && column-reverse
بتعكس اتجاه ال itemsعلي حسب اتجاه الصفحة
Flex-wrap
Default value is nowrap
Value of wrap
لما بكتبها في ال upبتخلي ال itemsالي عندي لو كتيره او عرضها اكبر من ال upبتنزل لصف جديد او
عمود جديد
Value of wrap-reverse
بتعمل wrapلل itemsبس في عكس االتجاه يعني بدل ما ينزلو لتحت بيطلعو فوق
Flex-flow
Is shorthand for flex wrap and flex direction
Write the two value of flex wrap and flex direction at it
Justify-content
Default value is flex-start
ممكن تحطهم في األول او االخر اوdirection of up بتاعي في مكان نسبي اليitems بتحط ال
النص
justify- فا كدا الflex direction is row and direction of up is ltf يعني مثال لو عندي ال
وال اخرها وال في النص وقيس كل الكالم داrow هتتحكم في العناصر انها تيجي في اول الcontent
column or rtf بقي لو
Spaces
Value of space between
بتعمل مسافات متساويه بين العناصر بس ملهاش دعوه باالطراف
Value of space around
بتعمل مسافات متساويه بين العناصر و مسافات بين األطراف بس بتكون مسافه األطراف اققل من
المسافات الي ما بين العناصر
Value of space evenly
بتعمل مسافات متساويه بين العناصر واالطراف
Align content
Work on all content without space
But works only when found more than one “column or row”
Align-items
Work on content but make space between them
Gap
بتديلها قيمه وبتكون القيمه دي هي المسافه الي ما بين العناصر وبعضها
Flex-Boxchildrens
Flex box here
We will talk about attributes that put only at children not parent
Algin-self
Same the value and تصرفof parent at align items
Order
default value is 0
If all numbers of order are equal, the position will “ ”يترتبaccording to the arrange
of them at html
Flex grow
Default value is zero
children ف الflex grow at children وانا روحت حطيت الparent لو فيه مساحه متبقيه من ال
الي انتا كاتبهالوvalue هياخد المساحه دي علي حسب ال
Flex shrink
Default value is 1
If I give to my item the highest value so priority of shrinking هتبقي ليه هوand he is
the first element will shrink
ف كل لما الرقم بيزيد بتاع االنكماش كل ما يكون ليه األولوية انه ينكمش عن العناصر التانيه الي معاه
Flex basis
Control at the
o Height of the element if flex direction is column
o Width of the element if flex direction is row
Auto
بس طالما المساحه المتبقيه تسمحcontent بتاخد مساحه علي قد ال
1fr (fraction)
بياخد نسبه من المساحه المتبقيه
بس بتكونauto هوا بياخد كل المساحه وبيسيب مساحه للauto البلطجي يعني لو اجتمع مع ال
المساحه الي سايبها علي قد الكونتنت بس
Minmax(min value , max value)
دي بتحددلك اققل قيمه واكبر قيمه ايه للعمود بتاعك
في الماكس فاليو عشانauto فيه مشكله اني لو مش عارف المحتوي بتاع عمود معين ف ممكن اكتب
دي تاخد مساحه وتكبر علي حسب المحتوي الي هيتكتب عشان الشكل ميبوظشcell ال
To use all areas founded write minmax() at volume of each one of them
column-gap
spaces between your columns
gap
it takes 2 value gap : (row gap value column gap value)
if u give one value he consider row gap value = column gap value
Grid template rows
Must determine the height of parent عشان تشغلthis attribute
justify content
work on x-axis only under any condition
this attribute doesn’t work when found repeat( number of columns , 1fr)
هتاخد المساحه كلهاfr اما الcontent هنا هتاخد مساحه الauto الن
Spaces
Value of space between
بتعمل مسافات متساويه بين الصفوف و مسافات بين األطراف بس بتكون مسافه األطراف اققل من
المسافات الي ما بين الصفوف
Value of space evenly
Align content
Work on y axis only under any conditions
This attribute doesn’t work when not found space of height at parent to elements
Spaces
Value of space between
بتعمل مسافات متساويه بين االعمده و مسافات بين األطراف بس بتكون مسافه األطراف اققل من
المسافات الي ما بين ا العمده
Value of space evenly
If u write this Grid-column : 1/-1 ; this mean your column cell will take all
cells of column founded at the selected column
Grid-area : head ;
Grid-template-area:
“head head . ”
.item2{
background-color: rgb(156, 250, 5);
margin: 10px;
padding: 10px;
grid-area: iteam2;
.item3{
background-color: rgb(227, 12, 195);
margin: 10px;
padding: 10px;
grid-area: iteam3;
.item4{
background-color: dimgrey;
margin: 10px;
padding: 10px;
grid-area: iteam4;
}
Shadow-box
Values at it
Box-shadow :
margin top
outline
فيvalue وبحط الinput بيظهر في لما بعملradius الخط الي بيظهر خارج البوكس وملهوش
none االغلب
Scale
</head>
Text align
It controls the inner content of element which has display block
it controls the position of the children elements according to parent element “ الزم
”االب يكون بلوك
direction
has two values is ltr or rtl
text transform
make your text uppercase or lowercase or capitalize
text decoration
when I put none value it deletes any decoratation for text
white space
browser deal with space by ignoring it at default, and solve this problem by
if I want the text to keep the parent wrap and in the same time want to appear
spaces give
word-wrap
if word is too long and exist from it’s parent so I give break down value to word
wrap to solve this problem
position
هو رقم بيحدد ترتيب الطبقات ( )stack orderللعناصر لما تتداخل فوق بعض.
كل ما الرقم أكبر → العنصر بيظهر قدام العناصر ذات الرقم األصغر.
بيشتغل فقط لو العنصر له positionغير ( staticيعني يكون relativeأو absoluteأو fixed
أو .)sticky
القيم:
List style
List-style : ‘none’ to hide the points