MMA NOTES by CodeWithJagadish
MMA NOTES by CodeWithJagadish
MMA NOTES by CodeWithJagadish
1. Define HTML?
<html>
</head>
</body>
Syntax:
HTML lists allow web developers to group a set of related items in lists.
Types:
1. Unordered List -
<li>BCA</li>
<li>BBA</li>
<li>BCOM</li>
</ul>
2. Ordered List -
Example -
<ol>
<li>BCA</li>
<li>BBA</li>
<li>BCOM</li>
</ol>
3. Definition List -
The <dl> tag defines the description list, the <dt> tag
defines the term (name), and the <dd> tag describes
each term.
Example -
<dl>
<dt>BCA</dt>
<dd>Technical Course</dd>
<dt>BBA</dt>
<dd>Management Course</dd>
</dl>
4. Define Table?
In HTML, form elements are used to create different types of user input
Syntax:
<form>
form elements
</form>
Example -
<html>
<frameset cols="25%,25%,25%,*">
<frame src="frames1.html">
<frame src="frames2.html">
<frame src="frames3.html">
<frame src="frames4.html">
</frameset>
</html>
2. Canvas element
4. Improved forms
6. Geolocation
9. Define CSS?
Properties of CSS -
and others.
Property 1 : value 1;
property 2 : value 2;
.......
Property n : value n;
1. Inline CSS -
Example:
2. Internal CSS -
Internal CSS refers to the use of CSS styling within the <head>
section of an
HTML document.
This is done by using the <style> tag to define the CSS styles that
will be applied to the HTML elements in the document.
Example:
<head>
<style>
body {
background-color: lightblue;
font-size: 16px;
h1{
font-style: italic;
</style>
</head>
3. External CSS -
By editing the .css file, we can change the whole site at once.
Example -
style.css
body {
background-color: lightblue;
font-size: 16px;
h1 {
color: red;
In the HTML document, add the following code to the <head> section to
1. Element Selector -
Syntax -
p{
/* styles go here */
2. Id Selector -
Syntax -
#my-id {
/* styles go here */
3. Class Selector -
Syntax -
.my-class {
/* styles go here */
4. Universal Selector -
Syntax -
*{
/* styles go here */
5. Group Selector -
The grouping selector is used to select all the elements with the
same style
definitions.
Syntax -
h1, h2, p {
/* styles go here */
1. CSS Font color - This property is used to change the color of the
text
color : red;
2. CSS Font family - This property is used to change the face of the
font.
font-size: 16px;
4. CSS Font style - This property is used to make the font bold,
italic or oblique.
font-style: italic;
font-variant: small-caps;
RGB format
RGBA format
Hexadecimal notation
HSLA
Built-in color
Syntax:
1. Selectors
2. Box Model
3. Typography
8. Grid Layout
Method 1 -
<script type = "text/javascript">
</script>
Method 2 -
UNIT- 2
Animation
1. What is Animation?
3. Define interpolation?
Syntax -
@keyframes
Transition
Transition-Delay
font-style
font-variant
font-weight
font-size
font-family
color
9. List CSS shorthand Properties?
Example -
<head>
<style>
div
width: 100px;
height: 100px;
background: red;
div:hover
width: 300px;
height: 300px;
transform: rotate(180deg);
}
</style>
</head>
<body>
<h1>Transition + Transform</h1>
<div></div>
</body>
</html>
UNIT- 3
HTML5 - SVG
Rectangle <rect>
Circle <circle>
Ellipse <ellipse>
Line <line>
Polyline <polyline>
Polygon <polygon>
Path <path>
<body>
</svg>
</body>
</html>
14. Write a program to create SVG rectangle ?
<html>
<body>
fill="red" />
</svg>
</body>
</html>
<body>
style="stroke:rgb(535,100,503);stroke-width:2" />
</svg>
</body>
<body>
style="fill:yellow;stroke:purple;stroke-width:2" />
</svg>
</body>
</html>
<body>
style="fill:purple;stroke:lime;stroke-width:5;fill-rule:nonzero;"/
>
</svg>
</body>
</html>
18. What is SVG gradient? List its types
Syntax:
Example Program -
<html>
<body>
<defs>
</defs>
</svg>
</body>
</html>
UNIT- 4
HTML5 - Canvas
1. What is Canvas ?
Example Program -
<html>
<head>
<style>
</style>
</head>
<body>
</body>
</html>
2. What is getContext?
The getContext, used to obtain the rendering context and its drawing
functions. This function takes one parameter, the type of context 2d.
1 fillRect(x,y,width,height) -
2. strokeRect(x,y,width,height) -
3. clearRect(x,y,width,height) -
1. beginPath() -
2. moveTo(x, y) -
This method creates a new subpath with the given point.
3. closePath() -
4. fill() -
This method fills the subpaths with the current fill style.
5. stroke() -
This method strokes the subpaths with the current stroke style.
1. lineWidth [ = value ] -
This property returns the current line width and can be set, to
change the line width.
2. lineCap [ = value ] -
This property returns the current line cap style and can be set, to
change the
3. lineJoin [ = value ] -
This property returns the current line join style and can be set, to
change the line join style
4. miterLimit [ = value ] -
This property returns the current miter limit ratio and can be set,
to change the miter limit ratio.
1. addColorStop(offset, color) -
This method adds a color stop with the given color to the gradient
at the given offset.
<html>
<body>
grd.addColorStop(0, "red")
grd.addColorStop(1, "white")
//Fill Style
ctx.fillStyle = grd;
</script>
</body>
</html>
UNIT- 5
HTML5 - Canvas
Syntax -
ctx.strokeText(text, x, y, maxWidth);
<body>
<script type="text/javascript">
var c = document.getElementById("myCanvas");
gradient.addColorStop("0", "magenta");
gradient.addColorStop("0.5", "blue");
gradient.addColorStop("1.0", "red");
ctx.strokeStyle = gradient;
</script>
</body>
</html>
Syntax -
createPattern(image, repetition)
Properties:
The save() method saves the state of the drawing context with all
its
attributes.
Here argument x is the amount the canvas is moved to the left or right,
and y is the amount it's moved up or down.
Example Program -
<html>
<body>
<h1>HTML5 Canvas</h1>
<script>
const c = document.getElementById("myCanvas");
ctx.translate(70, 70);
</script>
</body>
</html>
9. Write program to demonstration rotation in HTML5 canvas?
<html><body>
<h1>HTML5 Canvas</h1>
solid grey"></canvas>
<script>
const c = document.getElementById("myCanvas");
</script></body></html>
Example Program -
<script>
if (canvas.getContext) {
// rectangle width and height
// starting point
ctx.strokeStyle = 'red';
ctx.scale(2, 2);
ctx.strokeStyle = 'rgba(0,0,255,.2)';
</script>
Syntax:
context.globalCompositeOperation = "value"
Example Program -
<html><body>
<script>
const c = document.getElementById("myCanvas");
ctx.fillStyle = "red";
ctx.fillStyle = "blue";
ctx.globalCompositeOperation = "source-over";
ctx.fillStyle = "red";
ctx.fillStyle = "blue";
ctx.globalCompositeOperation = "destination-over";
</script></body></html>
function animate()
{
setInterval(drawShape, 1000);
function drawShape()
if (canvas.getContext) {
ctx.translate(70, 70);
} else {
</script>
</head>
</body></html>