Documente Academic
Documente Profesional
Documente Cultură
5. Define JDBC.
JDBC stands for Java Database Connectivity. It is a free open source application
programming interface for Java which enables the application to access the database. It
enables the developers to create queries, update data to the relational database using a
Structured Query Language (SQL).
8. What is XSL?
XSL is a language for expressing stylesheets. It consists of two parts: a language for
transforming XML documents, and. an XML vocabulary for specifying formatting
semantics
PART – B
11. Write a HTML code for creating a feedback from as shown below. Include
comments in code to highlight the markup elements and their purpose. The
HTML form should use POST for submitting the form to a program
ProcessContactForm.php
<html>
<head><title>Feedback Form</title></head>
<body>
<div class="imagebg"></div>
<div class="row " style="margin-top: 50px">
<div class="col-md-6 col-md-offset-3 form-container">
<h2>Feedback</h2>
<p>
Please provide your feedback below:
</p>
<form role="form" method="post" id="reused_form" action =”
ProcessContactForm.php“ >
<div class="row">
<div class="col-sm-12 form-group">
<label>How do you rate your overall experience?</label>
<p>
<label class="radio-inline">
<input type="radio" name="experience" id="radio_experience" value="bad" >
Bad
</label>
<label class="radio-inline">
<input type="radio" name="experience" id="radio_experience"
value="average" >
Average
</label>
<label class="radio-inline">
<input type="radio" name="experience" id="radio_experience" value="good"
>
Good
</label>
</p>
</div>
</div>
<div class="row">
<div class="col-sm-12 form-group">
<label for="comments">
Comments:</label>
<textarea class="form-control" type="textarea" name="comments"
id="comments" placeholder="Your Comments" maxlength="6000"
rows="7"></textarea>
</div>
</div>
<div class="row">
<div class="col-sm-6 form-group">
<label for="name">
Your Name:</label>
<input type="text" class="form-control" id="name" name="name" required>
</div>
<div class="col-sm-6 form-group">
<label for="email">
Email:</label>
<input type="email" class="form-control" id="email" name="email"
required>
</div>
</div>
<div class="row">
<div class="col-sm-12 form-group">
<button type="submit" class="btn btn-lg btn-warning btn-block" >Post
</button>
</div>
</div>
</form>
<div id="success_message" style="width:100%; height:100%; display:none; ">
<h3>Posted your feedback successfully!</h3>
</div>
<div id="error_message"
style="width:100%; height:100%; display:none; ">
<h3>Error</h3>
Sorry there was an error sending your form.
</div>
</div>
</div>
</body></html>
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<table border="1px">
<tr>
<td rowspan="2">Roll_No.</td>
<td rowspan="2">Name</td>
<td colspan="3"align="center">Marks</td>
</tr>
<tr>
<td>first term</td>
<td>second term</td>
<td>third term</td>
</tr>
<tr>
<td>1.</td>
<td>Arpit kumar</td>
<td>140</td>
<td>160</td>
<td>175</td>
</tr>
<tr>
<td>2.</td>
<td>Nilima Kapoor</td>
<td>190</td>
<td>180</td>
<td>116</td>
</tr>
<tr>
<td>3.</td>
<td>Prerna Sharma</td>
<td>130</td>
<td>115</td>
<td>175</td>
</tr>
</table>
</body>
</html>
There are three ways of inserting a style sheet: external, internal, and inline. The
browser will read the style definitions from the file myexternalstyle. css, and
apply the formatting to the pages linked to it accordingly. An internal style sheet
should be used when a single document has a unique style.
Inserting a Style Sheet
When a browser reads a style sheet, it will format the document according to
that style sheet. There are three ways of inserting a style sheet: external, internal,
and inline.
Typically, an external style sheet is used when the same style is applied to
multiple pages. In order to change the style for all these pages, you only need to
change the CSS syntax in the external style sheet. To link to the style sheet, each
page should contain the <link> tag included in the <head> section of the Web
page. For example:
<head>
<link rel="stylesheet" type="text/css" href="myexternalstyle.css" />
</head>
The browser will read the style definitions from the file myexternalstyle.css, and
apply the formatting to the pages linked to it accordingly.
An external style sheet can be edited in any text editor. The file needs to contain
CSS definitions only. HTML tags should not be included in the style sheet. Once
you have created the style sheet with your definitions, save the file with the .css
extension. Below is an example of the syntax contained in an external style sheet:
hr {color: red}
p {margin-left: 10px}body {background-color: yellow)}
Internal Style Sheet
An internal style sheet should be used when a single document has a unique
style. Internal styles will be defined in the <head> section of the page by using
the <style> tag.
<head>
<style type="text/css">
hr {color: red}
p {margin-left: 10px}
body {background-color:yellow)}
</style></head>
The browser will now read the style definitions and display the contents of the
Web pages, based on the formatting options listed in the style sheet.
Inline Styles
PART – C:
13. Use CSS and JavaScript to create a program that allows you to drag and
drop multiple images (including one with mouse) as thumbnails. When the
user clicks the image with mouse, it should follow the cursor until the
mouse button is released. When the other images are clicked, the larger
version should grow from top-left corner of the main image area till it
reaches its full size. Allow the user to select the page’s background color
and whether the page should use serif and sans serif fonts. Then change the
body element’s style attribute accordingly.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport"
content="width=device-width,
initial-scale=1.0,
user-scalable=no" />
<title>Drag/Drop/Bounce</title>
<style>
#container {
width: 100%;
height: 400px;
background-color: #333;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
border-radius: 7px;
touch-action: none;
}
#item {
width: 100px;
height: 100px;
background-color: rgb(245, 230, 99);
border: 10px solid rgba(136, 136, 136, .5);
border-radius: 50%;
touch-action: none;
user-select: none;
}
#item:active {
background-color: rgba(168, 218, 220, 1.00);
}
#item:hover {
cursor: pointer;
border-width: 20px;
}
</style>
</head>
<body>
<div id="outerContainer">
<div id="container">
<div id="item">
</div>
</div>
</div>
<script>
var dragItem = document.querySelector("#item");
var container = document.querySelector("#container");
function dragStart(e) {
if (e.type === "touchstart") {
initialX = e.touches[0].clientX - xOffset;
initialY = e.touches[0].clientY - yOffset;
} else {
initialX = e.clientX - xOffset;
initialY = e.clientY - yOffset;
}
function dragEnd(e) {
initialX = currentX;
initialY = currentY;
active = false;
}
function drag(e) {
if (active) {
e.preventDefault();
xOffset = currentX;
yOffset = currentY;
</html>
If you take all of this and paste it into a HTML document, you will see your own version
of this example working on your computer. Anyway, take a few moments to glance
through everything you see. The HTML and CSS should look simple. They just help us
define the draggable element and the container it lives in. The JavaScript inside
the script tag is where the excitement is at, so let's go through it more carefully.
Variable Declaration
At the very top, we declare some variables that we'll be using all over the place:
var dragItem = document.querySelector("#item");
var container = document.querySelector("#container");
e.preventDefault();
xOffset = currentX;
yOffset = currentY;
active = false;
}
We set our initial position for the next drag operation to be the current position. Since
our drag is now complete, we set the active variable to false.