Chapter 1
Chapter 1
Chapter 1
Internet Programming
Fig. IP Datagram
• The length of the datagram is variable.
• The datagram is divided into two part: header and data
• The length of the header is 20 to 60 bytes
• The header contains information for routing and delivery of the packet.
User Datagram Protocol(UDP)
• Like IP, UDP is connectionless and unreliable protocol.
• It doesn’t require making a connection with the host to exchange data.
• Since UDP is unreliable protocol, there is no mechanism for ensuring that data sent is
received.
• UDP is used by the application that typically transmit small amount of data at one time.
• UDP transmits the data in the form of a datagram.
• The UDP datagram consists of five parts as shown in the below diagram.
2 Authentication Yes No
Internet Programming
Internet Programming
Internet Programming
• All browsers have a default style sheet, which is designated as the least important.
• Whenever we define a CSS rule, we are actually overriding a default browser style
sheet rule. This is known as cascade in action.
CSS: Rule Cascading
• Sometimes two or more declarations are applied to the same element.
• When conflicts like this occur, the declaration with the highest weight is used.
• The weight is determined by the Cascade Rules.
• Cascade Rules:
1. Find all declarations whose selectors match a particular element.
2. Sort these declarations by weight and origin.
3. Sort the selectors by specificity.
4. Sort the order specified.
CSS: Rule Cascading Example
• Let’s use one HTML element <h2> as an example.
• Step 1. Find all declarations whose selectors match a particular element.
• After looking at all style sheets( browser, user and author), all the declarations that
match an <h2> element are found.
• The browser style sheet includes the following rule:
h2 { font-size: 1.5em; margin: .83em 0; color: black }
• The users style sheet includes the following rule:
h2 { color: brown !important; }
• The author style sheet includes the following rule:
h2 { color: green; font-size: 1.2em; padding: 10px; }
h2#main { color: red; }
h2.navigation { color: blue;}
CSS: Rule Cascading Example
• Step 2: Sort these declarations by weight and origin.
• For normal declarations, the author style sheets will override both user and browser
style sheets, unless there is an !important declaration in the user’s style sheet.
• For !important declarations , user style sheets override author and browser style
sheets.
font-size: 1.2em; /* author wins over browser */
margin: .83em 0; /* specified only by browser */
padding: 10px; /* specified only by author */
color: brown; /* user wins due to !important */
CSS: Rule Cascading Example
• Step 3: Sorting selectors by specificity.
h2 { font-size: 1.5em; margin: .83em 0; color: black }
0-0-1 > specificity = 001
Animation-fill-mode Specifies a style for the element when the animation is not playing (before
it starts, after it ends, or both)
Animation-iteration-count Specifies the number of times an animation should be played