HTML Css Notes
HTML Css Notes
Html element ?
An Html element is defined by a start tag,contents,end tag.
Syntax:
<tag_name>CONTENT</tag_name>
Html tags are like keywords which defines that how web browser will format and
display the content.
NOTE:
Some Html elements have no content these elements are called empty
elements.Empty elements do not have an end tag.
<tag_name> Content </tag_name>
| |
start tag/open tag end tag/close tag
what is attribute?
attribute is nothing but a property Which used to change the behaviour of elements.
Hyper Link:
It is used to navigate from one page to another page with help of href.
<a href=""></a> - anchor element.
1. Absolute Linking:
absolute linking - Entier URL
<a href="https://www.facebook.com/">Home</a> // absolute path
linking
2. Relative Linking:
Relative linking - file path from the project folder.
./ - it is used access files inside the project.
../ - it is used to access files outside the project folder.
<a href="./HTML.TXT">Home</a>
<!-----Relative linking-->
target-
it is used to traget which page i want to navigate.
multiple attribute inside target attribute:
-_self - it is used to navigate the page in same page but old page is overrided
by new page.
-_blank - it is used to navigate the page in new blank page.
Note: by default anchor will perform self action of navigation.
image extention
.png
.ico
.jpg
.jpeg
.mega
nesting of ol element:
embbeding multiple ol elements inside the ol tag .
image tag :
image tag is most important to add the picture to our webpage.
src - it is used to track the source of our image file.
alt - it is used to add the text to our default image thumbnail.
srcset - it is used to add responsive image with different resolution based on
screen size
it'll print the image.
Can i add multiple images in my image tag?
it is not possible.
<source/>
elements:
it is used to store block of text
<head> </head>
<title></title>
<body></body>
<a></a>
<nav></nav>
<div></div>
<ol></ol>
<ul></ul>
<section></section>
<li></li>
<p></p>
<pre></pre>
1.Inline way
By using Style attribute we can link some css property in Html.
<i class="fab fa-500px" style="font-size: 200px"></i>
2.Internal way:
By adding style tag we can specify the code in Html.
<style>
body {
background-color: crimson;
}
section {
background-color: darkgreen;
}
i {
color: deeppink;
}
</style>
3.External way:
By creating separate file and using link tag we can connect that file.
<link rel="stylesheet" href="./Style.css" />
File name Style.css
id:
Defines a unique identifier (ID)
which must be unique in the whole document.
Its purpose is to identify the element when
linking (using a fragment identifier),
scripting, or styling (with CSS).
class:
Class is the most prefered selector to select the element
with dot notation (".") in css.
Box modeling:
1.Margin:
with the help of margin we can align the block of text or image in webpage.
which is having two properties (marging: (top to bottom, left to right))
With help of margin we can make text invisible with negative number.
if the value of first property will be positive it'll align the block from top
to bottom.
if the value is negative it'll align the property from bottom to top.
if the value of second property will be positive it'll align the block from
left to right.
if the value is negative it'll align the property from right to left.
Note: margin means space between webpage to border.
2.padding:
with help of padding we can align the text inside the block.
padding will have two properties (padding: (top to bottom, left to right))
It'll not have negative value.
Note: padding means space between content to border.
3. border:
With the help of border we can build our block border line.
it's the space between block to margin.
border will have three property (border :(size shape color)).
dashed
solid
dotted
double
Box -modeling 🔢:
with help this modeling we can design the block based the Structure design we
want for that
we're using margin,padding,border.
inline element:
In inline element it'll take only the content width of the property.
Which'll consume less space in webpage.
it is not possible to convert block level into inline.
Features of html 5:
Doctype - it is used to identify which type document (browser)
- Browser works efficiently because it has clear meaning about the document
type.
- it case insensitive.
lang - which is used to identify which lang we're using.
Universal selector:
The Universal selector is build top on body tag.
So it'll override the body tag.
With the help of Universal selector we can select all the elements in the
document.
Inside Universal selector we can call margin and padding and assign value as 0
to
reduce the extra space of background images.
Universal selector always start with asterisk *.
Note: list attribute in input tag and datalist id name should be same otherwise
we'll be not
getting any suggestion.