Introduction to css Syntax
- CSS Selector points HTML element declaration block contains one or more declarations
- separated by semicolons.
- each CSS Selector declaration includes a CSS Property name and value ,separated by colon.
- CSS multiple declaration are separated with semicolons
- CSS element declaration blocks are surrounded by curly braces.
Introduction to css Syntax
Syntax
selector {
property: value;
}
Introduction to css Syntax
Example
<!DOCTYPE html> <html> <head> <title> html css Syntax </title> <style> p{ color:rgb(0, 8, 255); text-align:center; }
</style> </head> <body> <p>Hello every one</p> <p>My Name is web designing theory</p> <p>https://webdesigningtheory.blogspot.com/</p> <p>learn to programming language</p> <p>Easy understand</p>
</body> </html>
<!DOCTYPE html>
<html>
<head>
<title> html css Syntax </title>
<style>
p{ color:rgb(0, 8, 255);
text-align:center;
}
</style>
</head>
<body>
<p>Hello every one</p>
<p>My Name is web designing theory</p>
<p>https://webdesigningtheory.blogspot.com/</p>
<p>learn to programming language</p>
<p>Easy understand</p>
</body>
</html>
Introduction to css Syntax
Explain Program
<!DOCTYPE html>
- This declare the document type.
- browser that the document is written in html
Step 2]
<html>.... . </html>
- html is the root element of the html page.
- Every thing inside it is part of the webpage.
Step 3]
<head> Section
html head contains information about webpage.
html include CSS styles.
head section contains metadata about page. not visible on the page itself
Step 4]
<title>
<title> tag appears on the browser tab.
<title> tag use bookmark page name.
<title> tag use title in (SEO)search engine result.
Step 5]
<style>
p{ color:rgb(0, 8, 255);
text-align:center;
}
</style>
CSS internal css use html file.
P = all paragraph (<P>) tag elements.
color = rgb(0, 8, 255) blue color
text-align = center
Step 6]
closing the Tag
</style>
</head>
Step 7]
<body>
- < body> tag contains all the content visible to webpage.
- <body> tag contains all the visible content of the page.
- inside <body> show the browser screen.
Step 8]
<p>Hello every one</p> <p>My Name is web designing theory</p> <p>https://webdesigningtheory.blogspot.com/</p> <p>learn to programming language</p> <p>Easy understand</p>
<p>Hello every one</p>
<p>My Name is web designing theory</p>
<p>https://webdesigningtheory.blogspot.com/</p>
<p>learn to programming language</p>
<p>Easy understand</p>
html contain inside a <P> (paragraph) tag
All text is blue
All text is centered
Step 8]
closing the Tag
</body>
</html>
