HTML and Css
HTML and Css
1.Hyper Text Markup Language is standard markup language for creating web page
Markup Language=>using tags to define the elements ,human readable
eg:<title>title name</title>(title= tag)
2.It is used to describe the structure of the web page and its content
meta information=information about the web page(eg:title)it will not display in the web page
it is machine parsable(machine readable)=>eg:we will tell the computer want to do when
reload
4. <title>=a title for the HTML page (which is shown in the browser's title bar)
5. <body> =document's body,
6. <h1> =large heading
7. <p> =a paragraph
Html element
An HTML element is defined by a start tag, some content, and an end tag
<p>this is my paragraph</p>
<p>=start tag;this is my paragraph=content;</p>=end tag
Some HTML elements have no content (like the <br> element). These elements
are called empty elements. Empty elements do not have an end tag!
HTML headings
HTML headings are defined with the <h1> to <h6> tags.[h1>h6]
HTML links
HTML links are defined with the <a> tag
<a href="https://www.w3schools.com">This is a link</a>
HTML Attributes
Provide additional info of the element
Only present in start tag
It’s form=>name=”value”
eg:href=”value”
HTML empty tag
<hr>=horizontal line
<br>=new line
HTML tags
<pre></pre>=>what we have written in the html document will be presented without any
change in the web page (eg:poem)
HTML Style
The HTML style attribute is used to add styles to an element
<tagname style="property:value;">
HTML text formatting(does not start in new line)
HTML quotation
HTML Comment
HTML LINKS
Anchor tag<a>= used for links uses,
1. href attributes in <a> tag to indicate the destination
2.Target attributes in <a> tag to indicate where the link should get opened
_blank=new window,_self=same window
3.Use mailto: inside the href attribute to create a link that opens the
user's email program in <a> tag
Tooltip text =>we hover the mouse over the text it will define that text
eg:abbreviation[WHO]
HTML image
HTML favicon
CSS SELECTORS
1.universal selector
2.element selector
Specified element
h1{};
H1,h2{};
4.div.class{};
[it will select only div that has a class name that was specified
in the selector]
5.div b{};
6. direct child
ul>:nth-child(){};
Li.red~li{};
[~=>after the list that comes after the li.red will get the css
property]
[+=>very next chlid the list that comes after li.red will get the
css property]
9.pseudo class
10.Pseudo elements
Style the first letter, or line, of an element and Insert content before, or
after, the content of an element
Div::first-letter{};
11.class and id
12.attribute selector
input[type=”text”]{}
If some properties have been defined for the same selector (element) in
different style sheets[internal ,external,inline], the value from the last read
style sheet will be used.
Padding{all side}=>padding{3px}
Margin
Margins are used to create space around elements, outside of any
defined borders.
POSITION
STATIC
Normal document flow,default position is static.
RELATIVE
If we set element to position relative we also want to specifies the left
right top bottom of the position from its original position
ABSOLUTE
If we set element to position absolute set the left,right… of the position
from its parent position .To define the absolute property for child element the parent
element must be relative to the child.If the parent position is not defined it will take
the viewport as parent
FIXED
The positon will be fixed .its position is corresponds to the view port
STICKY
Static+fixed.It will be in formal document flow when the element which
the position is defined sticky get arrival it will get fixed in the screen
z-index=> define the stack order of the element(which element should be placed in
front of, or behind, the others).
Specificity
inline(1000)>id(100)>class,pesudo class,atrribute(10)>element,pesudo
element(1)>*(0)
!important rule, it will override ALL previous styling rules