Html & css
Html & css
STRUCTURE/LAYOUT
HTML(HYPER TEXTMARKUP
LANGUAGE)
HTML is a code that is used to structure
A web page and its content.
element
BASIC HTML PAGE:-
<!DOCTYPEhtml>
<html> root of an html document
<head> container for megadata
<title>------doc-----</title>
</head>
<body> contains all the data rendered by
browser
<p>hello world</p> paragraph tag
</body>
</html>
• This part • <html>=<HTM • This is used to
should not L> add some extra
• <p>=<P> information to
be praised. • <head>=<HE tags.
• <!--- AD>
comment--- • <body>=<BO
Html is BASIC
Comment DY>
s>
not case HTML
in html
sensitive TAGS
IMAGE
HEADING TAG PARAGRAPH TAG ANCHOR TAG
TAG
• Use to display • Use to add • Use to add link to • Use to add image
heading in html. paragraph in your page. to your page.
• H1(most imp.) html. • <img
• H2 • <p>--abc---</p> • <a src=“/image.png”
• H3 href=“https://goo alt=“random
• H4 gle. image”>
• H5 • com”>
• H6(least imp.)
UNORDERED ORDERED
<ul> <ol>
<li><li> <li><li>
<li><li> <li><li>
</ul> </ol>
TABLE IN Student
HTML Data ROLL
NAME
<TABLE>
NO
GUNGUN 8756
<tr>
<li>NAME</li>
<li>ROLL NO</li>
Caption in tables
</tr>
<caption>Student
<tr> Data</caption>
<li>GUNGUN</li>
<li>8756</li> <thead>- to wrap table
</tr> head.
<tbody>- to wrap table
</table> body
HTML
FORM IN HTML ACTION IN HTML
Forms are used to collect data Action attribute is used to
from the define what
User. Action needs to be performed
when a
Eg- signup/login/help Form is submitted.
request/contact me
LABEL
<label for = “id1”>
<input type= “radio” value= “classX” name=“class” id=“id1”>
</label>
CLASS & ID
<div id= “id1” class=“group1”>
</div>
TEXTAREA
<textarea name= “feedback” id=“feedback” placeholder=“pls add
feedback”
</textarea>
IFRAME TAG
Website inside website.
<iframe src= “link”>link</option>
SELECT
<select name = “city” id=“city”>
<option value=“delhi”>Delhi</option>
<option value=“mumbai”>Delhi</option>
<option value=“banglore”>Delhi</option>
</select>
VIDEO TAG
<video src= “muvid.mp4> My Video </video>
Attributes
-controls
-height
-width
-loop
-autoplay
CSS CODING
BORDERS:-
Border-style:;(solid ,dotted ,dashed ,groove ,hidden ,none ,double ,rigid )
(solid-dotted , solid-dashed, dashed-groove------)
Border-left-color:;(red, green, yellow, blue, pink, white, black )
Border-right-color:;(red, green, yellow, blue, pink, white, black )
Border-top-color:;(red, green, yellow, blue, pink, white, black )
Border-bottom-color:;(red, green, yellow, blue, pink, white, black )
Border-width:; ( 2px, 4px, 5px, 6px, -------)
Outline-style:;(same as same)
Outline-color:;(any)
Outline-offset:; ( 2px, 4px, 5px, 6px, -------)
Outline-width:; ( 2px, 4px, 5px, 6px, -------)
CSS
Writing mode values:-
Writing-mode : vertical-rl ;
: vertical-lr ;
: sideways – rl ;
: sideways – lr;
: horizontal – tb;
Column count:3;
column- gap : 100px;
column – rule – width: 2px;
column – rule – style : solid/dashed/double/groove;
column – rule – color : red;
column – width: 150px ;
column – span: all/none ;
CSS CODING
Padding:; ( 2px, 4px, 5px, 6px, -------)
Padding-top:; ( 2px, 4px, 5px, 6px, -------)
Padding-bottom:; ( 2px, 4px, 5px, 6px, -------)
Padding-left:; ( 2px, 4px, 5px, 6px, -------)
Padding-right:; ( 2px, 4px, 5px, 6px, -------)
MARGIN
Margin:; ( 2px, 4px, 5px, 6px, -------)
Margin-top:; ( 2px, 4px, 5px, 6px, -------)
Margin-right:; ( 2px, 4px, 5px, 6px, -------)
Margin-left:; ( 2px, 4px, 5px, 6px, -------)
Margin-bottom:; ( 2px, 4px, 5px, 6px, -------)
CSS CODING
TEXT FORMATTING
Text-align:;(left, right ,center)
Text-transform:;(lowercase, capitalize)
Text-shadow:;(top right obesity grey)
Text-decoration:;(underline ,line-through)
Text-indent:; (any size)
Letter-spacing:; (any size)
Line-height:; (any size)
Direction:; ( rtl , ltr )
Word-spacing:; (any size)
CSS CODING
BACKGROUND:-
Background – img : url();
Background-color:;(any)
Background-attachment:;(scroll/fixed)
Background-repeat:;(repeat /no-repeat /repeat-x /repeat-y )
Background-position:;(left-top /left-center /left-right)
(right-top /right-center /right-right)
(center-top /center-center /center-right)
Background-sixe;(cover, contain, auto)
CSS CODING
A{
Color;:
Background-color:;
}
A:hover{
Color;:
Background-color:;
}
P{
Font-family:;
Font-size:;
Font-weight:;
}
CSS CODING
Z-INDEX:-
IT decide the stack level of elements.
overlapping elements with larger z-index cover those with a smaller
one.
z-index:0
z-index: 1/2/3------- (most)
z-index: -1/-2/-3------- (least)
FLEXBOX PROPERTY :-
Justify-content : alignment along the main axis.
flex-start/flex-end/centre/space-evenlt;
Flex-wrap : nowrap / wrap / wrap-reverse
Align-items : alignment across the cross axis.
Align-content : alignment of space between & around the content
css
BOX MODEL:- CLEAR FLOAT :-
h2{ Img {
Background – color Float : left;
:red ; Margin – right :20px;
Padding : 30px; }
.abc{
Border: 4px solid
black; Clear : left ;
Margin : 50px ; : right ;
} : both ;
}
css
FLOAT:- MAX-WIDTH / MIN-WIDTH :-
IMG{ P{
Border : 1px solid red;
float: left;
Max/min – width : 500px;
} Margin : 0 ;
.box{ }
Height : 30px;
Background-color: red;
Width : 50px; ADVANCED COLOR:-
Body{
Float : left;
Background – color: #000000;
Margin-left : 10px; : #ffffff;
} : rgb(255 ,
35 ,44)
}
GRADIENT COLOR:-
Background – image :
linear/ radial-Gradient(red, yellow,
green)
css
<div>
<p></p>
</div>
Body { Overflow : scroll ; }
Div{
Background – color : lightgreen;
width : 400px ;
height : 150px;
overflow : hidden / scroll / unherit / auto
/visible ; }
OPACITY :-
H{opacity : 0.1 ;
<img src = “ ”>
}
css
OVERFLOW :-
The overflow properly specifies whether to clip content or to add scroll
bars . When the content of an element is too big to fit a specifies area .
The overflow properly has the following values.
VISIBLE :-
Default the overflow is not clipped . It renders outside the element’s box
.
HIDDEN :-
The overflow is clipped and the rest of the content will be invisible.
SCROLL :-
The overflow is clipped to set the rest of content.
AUTO :-
The overflow is clipped a scrollbar should be added to see the rest of the
content.
TEXT – OVERFLOW VALUES
Text – overflow : ellipsis;
: “[ * * ]” ;
: clip;
<body>
<ul>
<li> home </li>
<li> about us </li>
<li> services </li>
<li> products </li>
<li> contact us </li>
</ul>
Ul{
Margin: 0px;
Padding: 0px;
List – style: none;
Height: 36px;
Background – color : #000000;
Font – family : arial;
Font – size: 13px;
}
Li{
Float: left;
Border: 2px solid black;
}
.a{
Display: block;
Padding: 28px;
Color: #ffffff;
Text-decoration: none;}
A:hover{
Background- color: blue;}
Z-index