Internet Material Bca 1 - Unit 3 (CSS)
Internet Material Bca 1 - Unit 3 (CSS)
College
UNIT-3
Q.1 WHAT IS CSS? EXPLAIN TYPES OF CSS (3 OR 5 M) (MIMP) Easy maintenance − To make a global change, simply change the style, and all elements
in all the web pages will be updated automatically.
CSS Superior styles to HTML − CSS has a much wider array of attributes than HTML, so you
can give a far better look to your HTML page in comparison to HTML attributes.
CASCADING STYLE SHEET C – CASCADING - DESIGN LANGUAGE Multiple Device Compatibility − Style sheets allow content to be optimized for more
S – STYLE - HANDLES THE LOOK AND FEEL PART OF than one type of device.
INTRODUCTION TO CSS & TYPES OF CSS S – SHEET THE WEBPAGE
CLASS & ID SELECTOR Global web standards − Now HTML attributes are being deprecated and it is being
- CSS SAVE TIME
CSS FONT PROPERTY MAINTAINS BY - PAGES LOAD FASTER recommended to use CSS.
CSS TEXT PROPERTY W – WORLD - EASY
CSS BACKGROUND PROPERTY W – WIDE - GLOBAL WEB STANDARD
CSS MARGIN PROPERTY - MULTIPLE DEVICE COMPATIBILITY
TYPES OF CSS
W – WEB
CSS LIST PROPERTY C – CONSORTIUM CSS TYPE
INTRODUCTION TO CSS 3
CSS 3 BORDER PROPERTY
CSS 3 GRADIENT PROPERTY
CSS 3 DROP SHADOW PROPERTY DETAILS
INLINE INTERNAL EXTERNAL
CSS 3 2D & 3D TRANSFORM PROPERTY CSS INTORDUCTION
CSS 3 TRANSITION PROPERTY
CSS 3 BOX SIZING PROPERTY CSS stands for Cascading Style Sheets
CSS 3 POSITION PROPERTY Styles define how to display HTML elements - UNIQUE STYLE FOR - UNIQUE STYLE FOR SINGLE - STYLE SHEET FOR ENTIRE
CSS 3 MEDIA QUERY SINGLE ELEMENT PAGE WEBSITE
Styles are normally stored in Style Sheets
CSS FLEXBOX PROPERTIES - AFFECT ONLY ONE - AFFECT ONLY ONE PAGE - EXTENSION OF FILE IS .CSS
CSS describes how HTML elements are to be displayed on screen, paper, or in other
ELEMENT - SPECIFIED IN <HEAD> - LINK .CSS FILE WITH .HTML
media FILE
- STYLE ATTRIBUTE IS USED. SECTION
CSS saves a lot of work. It can control the layout of multiple web pages all at once o <H1 STYLE = - USE <STYLE> TAG - USING <LINK> TAG
External style sheets are stored in CSS files “COLOR:RED”>HI o <STYLE>
CSS Solved a Big Problem </H1> H1{ COLOR:RED; }
o HTML was NEVER intended to contain tags for formatting a web page! </STYLE>
o HTML was created to describe the content of a web page, like:
<h1>This is a heading</h1>
<p>This is a paragraph.</p> WORKING OF HTML, CSS & JAVASCRIP
When tags like <font>, and color attributes were added to the HTML 3.2
specification, it started a nightmare for web developers.
To solve this problem, the World Wide Web Consortium (W3C) created CSS.
CSS removed the style formatting from the HTML page!
Advantages of CSS
CSS saves time − You can write CSS once and then reuse same sheet in multiple HTML
pages.
Pages load faster − If you are using CSS, you do not need to write HTML tag attributes
every time. Just write one CSS rule of a tag and apply it to all the occurrences of that tag.
So less code means faster download times.
Prepared By – APKubavat Networking & Internet Environment 1 Prepared By – APKubavat Networking & Internet Environment 2 Prepared By – APKubavat Networking & Internet Environment 3
(BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1)
Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College
How to Insert a Style Sheet o To use inline styles you use the style attribute in the relevant tag. The style attribute p.center {text-align: center}
When a browser reads a style sheet, it will format the document according to it. There are can contain any CSS property.
three ways of inserting a style sheet: o The example shows how to change the color and the left margin of a paragraph: o You have to use the class attribute in your HTML document:
1. External Style Sheet <p style="color: sienna; margin-left: 20px"> <p class="right">
2. Internal Style Sheet This is a paragraph</p> This paragraph will be right-aligned.
3. Inline Style </p>
1 WORD QUESTION - ANSWER <p class="center">
1. External Style Sheet SR. QUESTION ANSWER This paragraph will be center-aligned.
o An external style sheet is ideal when the style is applied to many pages. NO </p>
o With an external style sheet, you can change the look of an entire Web site by 1 FULL FORM OF CSS CASCADING STYLE SHEET o To apply more than one class per given element, the syntax is:
changing one file. 2 CSS WAS MANAGED BY W3C <p class="center bold">
o Each page must link to the style sheet using the <link> tag. 3 FULLFORM OF W3C WORLD WIDE WEB CONSORTIUM This is a paragraph.
o The <link> tag goes inside the head section: 4 CSS IS USED TO HANDLES THE LOOK AND FEEL PART OF </p>
<head> THE WEBPAGE o You can also omit the tag name in the selector to define a style that will be used by all HTML
<link rel="stylesheet" type="text/css" href="mystyle.css" /> 5 HOW MANY TYPES OF CSS ARE THERE? 3 elements that have a certain class. In the example below, all HTML elements with
</head> 6 LIST OUT TYPES OF CSS. 1. INLINE class="center" will be center-aligned:
o The browser will read the style definitions from the file mystyle.css, and format the 2. INTERNAL .center {text-align: center}
document according to it. 3. EXTERNAL
o An external style sheet can be written in any text editor. The file should not contain 7 INLINE CSS IS USED TO GIVE UNIQUE STYLE FOR SINGLE ELEMENT o In the code below both the h1 element and the p element have class="center". This means
any html tags. Your style sheet should be saved with a .css extension. 8 INTERNAL CSS IS USED TO GIVE UNIQUE STYLE FOR SINGLE PAGE that both elements will follow the rules in the ".center" selector:
o An example of a style sheet file is shown below: 9 WHAT IS THE USE OF EXTERNAL STYLE SHEET? STYLE SHEET FOR ENTIRE WEBSITE
Hr {color: sienna} 10 GIVE THE EXTENSION OF EXTERNAL STYLE SHEET. .CSS <h1 class="center">
p {margin-left: 20px} This heading will be center-aligned
body {background-image: url("images/back40.gif")} Q.2 EXPLAIN CLASS SELECTOR AND ID SELECTOR (3 M) (MIMP) </h1>
<p class="center">
2. Internal Style Sheet SELECTORS This paragraph will also be center-aligned.
o An internal style sheet should be used when a single document has a unique style. </p>
You define internal styles in the head section by using the <style> tag, like this:
<head> The id Selector
ID CLASS
<style type="text/css"> o The id selector uses the id attribute of an HTML element to select a specific element.
hr {color: sienna} o The id of an element is unique within a page, so the id selector is used to select one unique
p {margin-left: 20px} - USED TO STYLE ELEMENT WITH - USED TO STYLE ELEMENT WITH element!
body {background-image: url("images/back40.gif")} SPECIFIED ID SPECIFIED CLASS o You can also define styles for HTML elements with the id selector. The id selector is defined
</style> - USE # SIGN - USE .(DOT) SIGN as a #.
</head> - APPLY STYLING IN ONE ELEMENT - APPLY STYLING IN MULTIPLE ELEMENT o The style rule below will match the element that has an id attribute with a value of "green":
o The browser will now read the style definitions, and format the document according #green {color: green}
to it. o The style rule below will match the p element that has an id with a value of "para1":
DETAIL p#para1{
3. Inline Style Sheet
Class Selector text-align: center;
o An inline style loses many of the advantages of style sheets by mixing content with o With the class selector you can define different styles for the same type of HTML element. color: red}
presentation. Use this method sparingly, such as when a style is to be applied to a o Say that you would like to have two types of paragraphs in your document: one right-aligned
single occurrence of an element. paragraph, and one center-aligned paragraph. Here is how you can do it with styles:
p.right {text-align: right}
Prepared By – APKubavat Networking & Internet Environment 4 Prepared By – APKubavat Networking & Internet Environment 5 Prepared By – APKubavat Networking & Internet Environment 6
(BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1)
Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College
Prepared By – APKubavat Networking & Internet Environment 7 Prepared By – APKubavat Networking & Internet Environment 8 Prepared By – APKubavat Networking & Internet Environment 9
(BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1)
Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College
Prepared By – APKubavat Networking & Internet Environment 10 Prepared By – APKubavat Networking & Internet Environment 11 Prepared By – APKubavat Networking & Internet Environment 12
(BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1)
Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College
Prepared By – APKubavat Networking & Internet Environment 13 Prepared By – APKubavat Networking & Internet Environment 14 Prepared By – APKubavat Networking & Internet Environment 15
(BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1)
Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College
Prepared By – APKubavat Networking & Internet Environment 16 Prepared By – APKubavat Networking & Internet Environment 17 Prepared By – APKubavat Networking & Internet Environment 18
(BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1)
Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College
Prepared By – APKubavat Networking & Internet Environment 19 Prepared By – APKubavat Networking & Internet Environment 20 Prepared By – APKubavat Networking & Internet Environment 21
(BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1)
Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College
Prepared By – APKubavat Networking & Internet Environment 22 Prepared By – APKubavat Networking & Internet Environment 23 Prepared By – APKubavat Networking & Internet Environment 24
(BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1)
Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College
Prepared By – APKubavat Networking & Internet Environment 25 Prepared By – APKubavat Networking & Internet Environment 26 Prepared By – APKubavat Networking & Internet Environment 27
(BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1)
Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College
background: -webkit-linear-gradient(bottom left, red, yellow); 1 WORD QUESTION - ANSWER blur-radius — Sets the blur radius. The larger the value, the bigger the
/* For Internet Explorer 10 */ SR. QUESTION ANSWER
blur and more the shadow's edge will be blurred. Negative values are not
background: -ms-linear-gradient(bottom left, red, yellow); NO
1 WHAT IS THE USE OF GRADIENT PROPERTIES? TRANSITIONS BETWEEN TWO OR MORE COLORS allowed.
/* Standard syntax */
background: linear-gradient(to top right, red, yellow); 2 LIST OUT GRADIENT PROPERTIES IN CSS3. 1. LINIAR GRADIENT color — Sets the color of the shadow. If the color value is omitted or not
2. RADIAL GRADIENT specified, it takes the value of the color property.
}
3. WHAT IS THE USE OF LINEAR GRADIENT? TWO OR MORE COLORS WITH LINEAR LINE
EXAMPLE
4. WHAT IS THE USE OF RADIAL GRADIENT? TWO OR MORE COLORS DEFINED BY THEIR CENTER
Creating CSS3 Radial Gradients 5. GIVE THE EXAMPLE OF LINEAR GRADIENT. background: linear-gradient(to top right, red, yellow); <!DOCTYPE html>
o In a radial gradient color emerge from a single point and smoothly spread outward in a 6. GIVE THE EXAMPLE OF RADIAL GRADIENT. background: radial-gradient(circle, red, yellow, lime) <html >
circular or elliptical shape rather than fading from one color to another in a single <head>
direction as with linear gradients. Q.11 EXPLAIN CSS 3 DROP SHADOW PROPERTY. (3 M) <style>
.box{
o The basic syntax of creating a radial gradient can be given with:
DROP SHADOW width: 200px;
radial-gradient(shape size at position, color-stop1, color-stop2, ...); height: 150px;
o The arguments of the radial-gradient() function has the following meaning: background: #112BCC;
position — Specifies the starting point of the gradient, which can be box-shadow: 5px 5px 10px red, 10px 10px 20px yellow;
- USED TO GIVE DROP - VALUES }
specified in units (px, em, or percentages) or keyword (left, bottom, etc).
SHADOW EFFETCS TO THE o offset-x </style>
shape — Specifies the shape of the gradient's ending shape. It can be
ELEMENT o offset-y </head>
circle or ellipse. o blur-radius
- TEXT SHADOW PROPERTY <body>
size — Specifies the size of the gradient's ending shape. The default o color
IS USED TO GIVE SHADOW <div class="box"></div>
is farthest-side. </body>
EFFECT TO THE TEXT
o Example </html>
.gradient { OUTPUT
/* Fallback for browsers that don't support gradients */
DETAIL
background: red;
The CSS3 gives you ability to add drop shadow effects to the elements like you do in Photoshop
/* For Safari 5.1 to 6.0 */
background: -webkit-radial-gradient(red, yellow, lime); without using any images.
/* For Internet Explorer 10 */ Prior to CSS3, sliced images are used for creating the shadows around the elements that was
background: -ms-radial-gradient(red, yellow, lime); quite annoying.
/* Standard syntax */ CSS3 box-shadow Property
background: radial-gradient(red, yellow, lime); o The box-shadow property can be used to add shadow to the element's boxes.
}
o You can even apply more than one shadow effects using a comma-separated list of
o Setting the Shape of Radial Gradients 1 WORD QUESTION - ANSWER
.gradient { shadows.
SR. QUESTION ANSWER
/* Fallback for browsers that don't support gradients */ o The basic syntax of creating a box shadow can be given with: NO
background: red; box-shadow: offset-x offset-y blur-radius color; 1 WHAT IS THE USE OF BOX SHADOW PROPERTY? DROP SHGADOW EFFECT TO THE ELEMENTS
/* For Safari 5.1 to 6.0 */ o The components of the box-shadow property have the following meaning: 2 WHAT IS OFFSET-X AND OFFSET-Y VALUES? HORIZONTAL & VERTICAL OFSETS OF SHADOW
background: -webkit-radial-gradient(circle, red, yellow, lime); offset-x — Sets the horizontal offset of the shadow. 3. WHAT IS BLUR-RADIUS VALUE? SHADOW’S EDGE WILL BE BLURRED
/* For Internet Explorer 10 */ 4. WHAT IS COLOR VALUE? COLOR OF THE SHADOW
offset-y — Sets the vertical offset of the shadow.
background: -ms-radial-gradient(circle, red, yellow, lime); 5. GIVE THE EXAMPLE OF BOX SHADOW. background: linear-gradient(to top right, red, yellow);
/* Standard syntax */
background: radial-gradient(circle, red, yellow, lime);}
Prepared By – APKubavat Networking & Internet Environment 28 Prepared By – APKubavat Networking & Internet Environment 29 Prepared By – APKubavat Networking & Internet Environment 30
(BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1)
Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College
Q.12 EXPLAIN CSS 3 2D & 3D TRANSFORM PROPERTY. (3 OR 5M) (MIMP) b. The rotate() Function The function skew(-40deg, 15deg) skews the element -40 degree horizontally
i. The rotate() function rotates the element around its origin (as specified by along the x-axis, and 15 degree vertically along the y-axis.
TRANSFORM the transform-origin property) by the specified angle. This can be written
as rotate(a). 2D Transform Functions
Example
Function Description
img {
2D 3D -webkit-transform: rotate(30deg); /* Chrome, Safari, Opera */ translate(tx,ty) Moves the element by the given amount along the X and Y-axis.
-moz-transform: rotate(30deg); /* Firefox */
-ms-transform: rotate(30deg); /* IE 9 */ translateX(tx) Moves the the element by the given amount along the X-axis.
- PERFORM BASIC - PERFORM BASIC transform: rotate(30deg); /* Standard syntax */ translateY(ty) Moves the the element by the given amount along the Y-axis.
TRANSFORM ON AN TRANSFORM ON AN }
rotate(a) Rotates the element by the specified angle around the origin of the element, as
ELEMENTS IN A 2D SPACE ELEMENTS IN A 3D SPACE
The function rotate(30deg) rotates the image in clockwise direction about its defined by the transform-origin property.
origin by the angle 30 degrees. You can use negative values to rotate the
- FUNCTIONS : - FUNCTIONS : scale(sx,sy) Scale the width and height of the element up or down by the given amount. The
element counter-clockwise.
o TRANSLATE() o TRANSLATE3D() function scale(1,1) has no effect.
o ROTATE() o ROTATE3D() c. The scale() Function scaleX(sx) Scale the width of the element up or down by the given amount.
o SCALE() o SCALE3D() i. The scale() function increases or decreases the size of the element. It can be
o SKEW() scaleY(sy) Scale the height of the element up or down by the given amount.
written as scale(sx, sy). If sy isn't specified, it is assumed to be equal to sx.
Example skew(ax,ay) Skews the element by the given angle along the X and Y-axis.
img {
DETAIL -webkit-transform: scale(1.5); /* Chrome, Safari, Opera */ skewX(ax) Skews the element by the given angle along the X-axis.
1. 2D Transformation of Elements -moz-transform: scale(1.5); /* Firefox */ skewY(ay) Skews the element by the given angle along the Y-axis.
-ms-transform: scale(1.5); /* IE 9 */
With CSS3 2D transform feature you can perform basic transform manipulations such as transform: scale(1.5); /* Modern Browsers */
2. 3D Transformation of Elements
move, rotate, scale and skew on elements in a two-dimensional space. }
With CSS3 3D transform feature you can perform basic transform manipulations such as
A transformed element doesn't affect the surrounding elements, but can overlap them, just The function scale(1.5) proportionally scale the width and height of the
image 1.5 times to its original size. The function scale(1) or scale(1, 1) has no move, rotate, scale and skew on elements in a three-dimensional space.
like the absolutely positioned elements.
effect on the element. A transformed element doesn't affect the surrounding elements, but can overlap them, just
Using CSS Transform and Transform Functions
like the absolutely positioned elements. However, the transformed element still takes space
a. The translate() Function d. The skew() Function in the layout at its default (un-transformed) location.
i. Moves the element from its current position to a new position along the X and Y i. The skew() function skews the element along the X and Y axes by the specified Using CSS Transform and Transform Functions
axes. This can be written as translate(tx, ty). If ty isn't specified, its value is angles. It can be written as skew(ax, ay). If ay isn't specified, its value is assumed
The CSS3 transform property uses the transform functions to manipulate the coordinate
assumed to be zero. to be zero.
system used by an element in order to apply the transformation effect.
Example Example
a. The translate3d() Function
img { img {
-webkit-transform: translate(200px, 50px); /* Chrome, Safari, Moves the element from its current position to a new position along the X, Y
-webkit-transform: skew(-40deg, 15deg); /* Chrome, Safari, Opera */
Opera */ -moz-transform: skew(-40deg, 15deg); /* Firefox */ and Z-axis. This can be written as translate(tx, ty, tz). Percentage values are
-moz-transform: translate(200px, 50px); /* Firefox */ -ms-transform: skew(-40deg, 15deg); /* IE 9 */ not allowed for third translation-value parameter (i.e. tz).
-ms-transform: translate(200px, 50px); /* IE 9 */ transform: skew(-40deg, 15deg); /* Modern Browsers */ Example
transform: translate(200px, 50px); /* Standard syntax */ } } .container {
width: 125px;
Prepared By – APKubavat Networking & Internet Environment 31 Prepared By – APKubavat Networking & Internet Environment 32 Prepared By – APKubavat Networking & Internet Environment 33
(BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1)
Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College
Prepared By – APKubavat Networking & Internet Environment 34 Prepared By – APKubavat Networking & Internet Environment 35 Prepared By – APKubavat Networking & Internet Environment 36
(BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1)
Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College
} DETAIL
DETAIL The box-sizing CSS property is used to alter the default CSS box model, which is normally used
button:hover {
Normally when the value of a CSS property changes, the rendered result is instantly updated. A by the browser to calculate the widths and heights of the elements.
background: #3cc16e;
common example is changing the background color of a button on mouse hover.
border-color: #288049;
In a normal scenario the background color of the button is changes immediately from the old Syntax
}
property value to the new property value when you place the cursor over the button. box-sizing: content-box | padding-box | border-box | initial | inherit
CSS3 Transition Properties
CSS3 introduces a new transition feature that allows you to animate a property from the old
Property Description Example
value to the new value smoothly over time.
Transition A shorthand property for setting all the four individual transition .box {
The following example will show you how to animate the background-color of an HTML button properties in a single declaration. width: 50%;
on mouse hover. transition-delay Specifies when the transition will start. padding: 15px;
Example transition-duration Specifies the number of seconds or milliseconds a transition animation float: left;
should take to complete. border: 5px solid #000;
button {
transition-property Specifies the names of the CSS properties to which a transition effect box-sizing: border-box;
background: #fd7c2a; }
should be applied.
/* For Safari 3.0+ */
transition-timing-function Specifies how the intermediate values of the CSS properties being affected
-webkit-transition-property: background; Property Values
by a transition will be calculated.
-webkit-transition-duration: 2s; Value Description
/* Standard syntax */ 1 MARK QUESTION - ANSWER The specified width and height properties include only the content of the element. It
content-box
transition-property: background; SR. QUESTION ANSWER does not include the padding, border or margin.
transition-duration: 2s; NO
The specified width and height properties include the padding size, and do not include
1 WHAT IS THE USE OF TRANSITION TRANSFORM? ANIMATE THE PROPERTY FROM OLD VALUE TO NEW padding-box
} the border or margin.
VALUE OF AN ELEMENT
button:hover { The specified width and height properties include the padding and border, but not the
2 TRANSITION-DELAY PROPERTY IS USED SPECIFIES WHEN THE TRANSITION WILL START border-box
background: #3cc16e; TO
margin.
} 3. TRANSITION-DURATION PROPERTY IS USED TO NUMBER OF SECONDS OR MILLISECONDS A initial Sets this property to its default value.
SPECIFIES TRANSITION ANIMATION SHOULD TAKE TO If specified, the associated element takes the computed value of its parent element
COMPLETE. inherit
Performing Multiple Transitions box-sizing property.
Each of the transition properties can take more than one value, separated Q.14 EXPLAIN CSS 3 BOXSIZING PROPERTY. (2 M)
1 MARK QUESTION - ANSWER
by commas, which provides an easy way to define multiple transitions at once
BOXSIZING SR. QUESTION ANSWER
with different settings. NO
Example 1 WHICH PROPERTY IS USED TO SET BORDER BOX OF BOX SIZING
button { DIV TAG?
background: #fd7c2a; - EXAMPLE 2 WHICH PROPERTY IS USED TO SET HEIGHT, WIDTH, BORDER-BOX
- USE IN BOX MODEL
PADDING AND BORDER OF BOX?
border: 3px solid #dc5801; - MOSTLY USED WITH <DIV> .box {
3. WHICH PROPERTY IS USED TO SET HEIGHT, WIDTH, PADDING-BOX
/* For Safari 3.0+ */ - PROPERTIES width: 100%;
AND PADDING OF BOX?
-webkit-transition-property: background, border; o content-box padding: 20px;
4 WHICH PROPERTY IS USED TO SET HEIGHT & CONTENT-BOX
border: 5px solid #f08080;
-webkit-transition-duration: 1s, 2s; o padding-box WIDTH OF BOX?
box-sizing: border-box;
/* Standard syntax */ o border-box }
transition-property: background, border;
transition-duration: 1s, 2s;
Prepared By – APKubavat Networking & Internet Environment 37 Prepared By – APKubavat Networking & Internet Environment 38 Prepared By – APKubavat Networking & Internet Environment 39
(BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1)
Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College
Prepared By – APKubavat Networking & Internet Environment 40 Prepared By – APKubavat Networking & Internet Environment 41 Prepared By – APKubavat Networking & Internet Environment 42
(BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1)
Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College
Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College Shir Matrumandir B.S.W. College
<p>The "align-items: center;" aligns the flex items in the middle of the container:</p> <h1>The align-content Property</h1>
<div class="flex-container"> <p>The "align-content: space-between;" displays the flex lines with equal space between them:</p>
<div>1</div>
<div>2</div> <div class="flex-container">
<div>3</div> <div>1</div>
</div> <div>2</div>
<div>3</div>
</body> <div>4</div>
</html> <div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
align-content <div>9</div>
<div>10</div>
The align-content property is used to align the flex lines. <div>11</div>
<div>12</div>
<!DOCTYPE html> </div>
<html>
<head> </body>
<style> </html>
.flex-container {
display: flex;
height: 600px;
flex-wrap: wrap;
Prepared By – APKubavat Networking & Internet Environment 49 Prepared By – APKubavat Networking & Internet Environment 50 Prepared By – APKubavat Networking & Internet Environment 51
(BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1) (BCA/BSCIT/PGDCA -1)