Show how to add CSS to HTML. Give example

1) <head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>

<head>

<style>
2)hr {color:sienna;}
p {margin-left:20px;}
body {background-image:url("images/back40.gif");}
</style>
</head>

What is the Difference between XML and HTML? Give example.

The Difference Between XML and HTML

XML is not a replacement for HTML.

XML and HTML were designed with different goals:

· XML was designed to transport and store data, with focus on what data is

· HTML was designed to display data, with focus on how data looks

HTML is about displaying information, while XML is about carrying information.

<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>

How we can convert HTML to XHTML? Give example.

1. Add an XHTML <!DOCTYPE> to the first line of every page

2. Add an xmlns attribute to the html element of every page

3. Change all element names to lowercase

4. Close all empty elements

5. Change all attribute names to lowercase

6. Quote all attribute values

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Title of document</title>
</head>
<body>

Write examples that shows you how to add margins and padding to HTML using CSS

1.margin

<!DOCTYPE html><html><head><style>

p{background-color:yellow;}

p.margin{

margin-top: 100px;

margin-bottom: 100px;

margin-right: 50px;

margin-left: 50px;} </style> </head>

2.padding

<!DOCTYPE html>

<html><head><style>

p{background-color:yellow;}

p.padding{

padding-top: 25px;

padding-bottom: 25px;

padding-right: 50px;

padding-left:50px;} </style> </head>

What is JavaScript? Write everything about it.

JavaScript is a Scripting Language

A scripting language is a lightweight programming language.

JavaScript is programming code that can be inserted into HTML pages.

JavaScript code can be executed by all modern web browsers.

JavaScript is easy to learn.

<button type="button" onclick="alert('Welcome!')">Click Me!</button>

<script>

function myFunction()

{

x=document.getElementById("demo") // Find the element

x.style.color="#ff0000"; // Change the style

}

</script>

<script>
document.write("<h1>This is a heading</h1>");
document.write("<p>This is a paragraph</p>");
</script>


Понравилась статья? Добавь ее в закладку (CTRL+D) и не забудь поделиться с друзьями:  



double arrow
Сейчас читают про: